SQL Server Performance

'Convert' and 'MAX' Functions

Discussion in 'SQL Server 2005 Reporting Services' started by Toni, Apr 20, 2006.

  1. Toni New Member

    I have a dataset in RS that basically just popultes a report parameter field automatically for me. The small peice of SQL that I run is<br /><br />SELECT MAX (src_date) AS LatestMonth<br />FROM dbo.tbl_src_date<br /><br />The problem I have is a visual one in that it all works but the output that is placed in the relevant report parameter box is mm/dd/yyyy hh:mm<img src='/community/emoticons/emotion-7.gif' alt=':s' />s.<br /><br />All I want to see in this box is dd/mm/yyyy and no time. On top of this I also wish it to select the hoghest date value it finds in the query result hence the MAX statement. How can I convert the datetime to the format I want and run a MAX statement at the same time.<br />Or should I use the format command as it is only a visual thing? If yes, what is the SQL for that and MAX?<br /><br />Thanks in advance<br /><br /><br /><br />Toni Chaffin<br />aka Toni
  2. Madhivanan Moderator

    Does not SSRS support Format function? In Crystal Reports, you can format it using Format function. See if you find the same in SSRS. Otherwise look for convert function in sql server help file

    Madhivanan

    Failing to plan is Planning to fail
  3. jhermiz New Member

    Yes it does support the format function, but it is also unnecessary. If you right click this field you can change the properties so that it only presents the date not the date and time.

    Jon

    www.web-impulse.com
  4. Toni New Member

    Thank you jhermiz

    Regards


    Toni Chaffin
    aka Toni

Share This Page