Date range defaults

  • Hello and happy Friday!

    I have a several reports that accept date range parameters. These are not the textboxes that show you a calendar when you click the box, but just 2 simple textboxes (Startdate and Enddate). Is there a way for me to force the user to type in a date range in 'mm/dd/yyyy' format? Also is there a way where I can at least have 'mm/dd/yyyy' as a default in the textboxes so they know what format to use or prehaps a default date range for the current day dynamically hardcoded into the date range text boxes?

    Here is the code that I have in the dataset properties. Thank you all in advance.

    Select * from v_SQL_VIEW

    WHERE Dates Between @Startdate and @Enddate

    order by 1

  • DaveDB (11/1/2013)


    I have a several reports that accept date range parameters. These are not the textboxes that show you a calendar when you click the box, but just 2 simple textboxes (Startdate and Enddate). Is there a way for me to force the user to type in a date range in 'mm/dd/yyyy' format? Also is there a way where I can at least have 'mm/dd/yyyy' as a default in the textboxes so they know what format to use or prehaps a default date range for the current day dynamically hardcoded into the date range text boxes?

    Why wouldn't you use the date/time parameter data type. The user can enter a date in the textbox portion of the control, or use the calendar if they choose to graphically select the date. You can use an expression to set the default values. Putting this into a string is recreating the wheel.

    Rob

  • Thanks Rob. I will look into this option.

  • That worked perfect! I thought that because my report is looking at the date parameter as a string in my view that it wouldn't work and I would get a conversion error. Much appreciated 🙂

  • I'm happy that worked out and I'm glad to help.

    Rob

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply