March 14, 2016 at 7:20 am
I have date and time stored in the following format: mm-dd-yyyy hh:mm:ss
I only need the date part, and want to use a data parameter where I specify only one date ie 14/03/2016
So I have used
convert(varchar,ScheduledActivity.ScheduledDateTime,103)
This gives me what I want in the output, but if I search for ScheduledActivity.ScheduledDateTime = 13/04/2016 I get the following error, or no rows returned at all. 'The conversion of a varchar datatype to a datetime datatype resulted in an out of range value'
What should I be doing? It works of I use a between and 2 dates but I only want the user to enter one date into the report parameter.
Thanks
March 14, 2016 at 8:05 am
Duplicate post. Please put replies on this thread, http://www.sqlservercentral.com/Forums/Topic1769091-2799-1.aspx
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply