none
Parameter Date Format in ssrs

    Question

  • Hi,

    I have a date parameter with mm/dd/yyyy format.

    Pls tel me how can i get dd/mm/yyyy format.

    I used defaultvalue as format(parameters!date.value,"dd/MM/yyyy")

    That is not working pls help me


    Thanks,

    Krishna

    Saturday, November 05, 2011 1:58 PM

Answers

  • Hi Krishna_ece,

    Please refer to the expression below to have a try, you can replace the date string value "06/07/2011" to your relevant field value expression Pameters!date.value:
    =format(CDate("06/07/2011"),"dd/MM/yyyy")

    Thanks,
    Bill Lu


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, November 07, 2011 8:14 AM
    Moderator

All replies

  • Hi Krishna,

    If you are UK based.

    Within BIDS; - Click on the design area of your report, the press F4 to bring up the report properties.

    Enter en-GB as you language properties.

    With Windows 7 , click on Control Panel->Clock,Lanuage and Region->Region and Language->Change the date, time, or number format. Ensure the format is set to "English (United Kingdom)",etc.

    When you next create a date parameter within SSRS it should appear in the British format dd/mm/yyyy as default.

    Kind Regards,

    Kieran.

     


    If you have found any of my posts helpful then please vote them as helpful. Kieran Patrick Wood MCTS BI, PGD SoftDev (Open), MBCS, MCC http://uk.linkedin.com/in/kieranpatrickwood
    Saturday, November 05, 2011 4:58 PM
  • Hi,

    Thank you for the reply..

    Iam not UK based.Iam India.

     my language setting in BIDS is us(en).

    Pls help on this.....

    Saturday, November 05, 2011 7:17 PM
  • Can you not enter en-GB as your language properties just for the report which you want to enter the UK date format, .i.e. dd/mm/yyyy?

     Otherwise it's back to using the Format expression; -

    http://msdn.microsoft.com/en-us/library/ms157328.aspx

    and

    http://msdn.microsoft.com/en-US/library/8kb3ddd4(v=VS.80).aspx

     


    If you have found any of my posts helpful then please vote them as helpful. Kieran Patrick Wood MCTS BI, PGD SoftDev (Open), MBCS, MCC http://uk.linkedin.com/in/kieranpatrickwood
    Saturday, November 05, 2011 9:30 PM
  • Ya i tried with en-GB stil not working
    Saturday, November 05, 2011 9:47 PM
  • Hi Krishna_ece,

    Please refer to the expression below to have a try, you can replace the date string value "06/07/2011" to your relevant field value expression Pameters!date.value:
    =format(CDate("06/07/2011"),"dd/MM/yyyy")

    Thanks,
    Bill Lu


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, November 07, 2011 8:14 AM
    Moderator
  • These date format issues are a bit of a bugbear. I'd advise passing the ISO formatted date string to your query, which will always work regardless of regional settings or bugs.

    DECLARE @sampleDATE DATETIME; -- Imagine this is the reporting services parameter passed to your query.

    SET @sampleDATE = '2011-12-01';

    SELECT CONVERT(varchar(10), @sampleDate, 120) -- do this conversion when passing the date to your queries, and pass as a string.

    It might not be the 'correct' solution, but it works.


    Josh Ash
    Tuesday, November 08, 2011 3:37 AM