SQL Reporting Services - Supply values to DateTime parameter

I have a query which is supposed to supply default values to Date_From and Date_To parameters for a report query.

The SELECT statement below provides date in the format YYYY/MM/DD , apparently this is not the format expected by the DateTime parameter.

What is value would DateTime be looking for?
egxisAsked:
Who is Participating?
 
psychic_zeroConnect With a Mentor Commented:
I think the format it looking for is in format MM/DD/YYYY HH:MM:SS AM
eg. 6/20/2008 5:40:10 PM
0
 
rob_farleyConnect With a Mentor Commented:
Try using the format YYYYMMDD - without the slashes. Almost everything else is location-dependent.

If that still doesn't like it, try:

select cast('20080620' as datetime)

...to force it to evaluate it as a datetime, rather than a string.

Rob
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.