none
Format the Date in SSRS Parameters

    Question

  • Hi all,

    I am  using  a  parameter called Date, and this parameter takes  a default value from this expression  =Globals!ExecutionTime
    I need to format the time to show only date with no time 
    I use this expression that i usually used  to format date shown in table cells or text-boxes and it works fine 
    =Format (CDate(Globals!ExecutionTime ,"dd/MM/yyyy"))
     but this expression does not work for the parameter, any suggestion !!! 
    Wednesday, February 03, 2010 10:53 AM

Answers

  • Hi Sorry for misunderstanding. See below

    =CDate(Format(Globals!ExecutionTime,"dd/MM/yyyy"))
    • Marked as answer by Eng. Alaa Wednesday, February 03, 2010 12:49 PM
    • Unmarked as answer by Eng. Alaa Sunday, February 21, 2010 1:15 PM
    • Marked as answer by Eng. Alaa Sunday, April 11, 2010 6:47 AM
    Wednesday, February 03, 2010 12:48 PM

All replies

  • =formatdatetime(now(),2)

    try this
    Praxy
    Wednesday, February 03, 2010 11:10 AM
  • Hi Praxy1,

    I tried it, it does not work !!! :S 

    It gives me this error 

    "the property Default Value " of report parameter 'Date' Does not have the the expected value 

    Note:the parameter called  Date  is a DateTime field 
    Wednesday, February 03, 2010 11:17 AM
  • paste the expression u r using
    Praxy
    Wednesday, February 03, 2010 11:27 AM
  • Is it what you are looking for?

    =Format(now,"dd/MM/yyyy")

    Wednesday, February 03, 2010 11:40 AM
  • =Format (CDate(Globals!ExecutionTime ,"dd/MM/yyyy")) it does not work !!! 
    Wednesday, February 03, 2010 11:46 AM
  • hi Mr. VS Patel
    =Format(now,"dd/MM/yyyy") does not work too , it give me the above error 

    Wednesday, February 03, 2010 11:47 AM
  • Hi

    Why are you trying to conver date time to datetime? See below this is working for me.

    Create textbox in report and set below as expression to see results.

    =Format(Globals!ExecutionTime,"dd/MM/yyyy")

    Wednesday, February 03, 2010 11:51 AM
  • hi Mr. VS Patel 

    this expression works for a text box as I  said above
    but my problem is with parameters 

    it does not work !!! 


    Wednesday, February 03, 2010 12:39 PM
  • Format will make expression into string.

    Use CDATE instead.


    Please vote for answer if it helps you.
    Wednesday, February 03, 2010 12:45 PM
  • Hi Sorry for misunderstanding. See below

    =CDate(Format(Globals!ExecutionTime,"dd/MM/yyyy"))
    • Marked as answer by Eng. Alaa Wednesday, February 03, 2010 12:49 PM
    • Unmarked as answer by Eng. Alaa Sunday, February 21, 2010 1:15 PM
    • Marked as answer by Eng. Alaa Sunday, April 11, 2010 6:47 AM
    Wednesday, February 03, 2010 12:48 PM
  • hi VS Patel 

    thank you very much 

    it really work !!! 
    am so pleased , a big thanx for u 


    thnx too Mr, Jayeshonline
    Now  I could  understand the cause of the error :)
    Wednesday, February 03, 2010 12:50 PM
  • hi every body,

    After this solution works from the date I marked it as  a solution, It seems to be not working know and I dont know what is the problem
    when I run the report a message error appears saying " local error processing in date parameter" any suggestion !!! where is the problem ?? it is really very confusing case !!!! 
    Sunday, February 21, 2010 1:31 PM
  • It looks to me like if you set up a parameter as a Date/Time and set the default value (inside the fx) to something like this:

    =DateValue(Now())

    that it displays the date without the time and it even works when you select another value from the date picker calendar.

    Wednesday, July 07, 2010 4:12 PM