November 1, 2013 at 12:47 pm
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
November 3, 2013 at 7:07 pm
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
November 4, 2013 at 8:30 am
Thanks Rob. I will look into this option.
November 4, 2013 at 8:50 am
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 🙂
November 4, 2013 at 10:21 am
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