gvilbis
asked on
sql, how do i run select command where issuedate is between range of date?
i would like to run select sql command with where condition which is from type of datetime and the condition "where" will be date and not datetime
issuedate is look like: 2007-03-22 00:00:00.000
what i have to change in the below sql command that it will run?
select * from cutheader where issuedate between '2007-0-22' and '2008-02-27'
Server: Msg 242, Level 16, State 3, Line 1
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
issuedate is look like: 2007-03-22 00:00:00.000
what i have to change in the below sql command that it will run?
select * from cutheader where issuedate between '2007-0-22' and '2008-02-27'
Server: Msg 242, Level 16, State 3, Line 1
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
ASKER
when i run the following:
select * from cutheader where issuedate >= 'strtotime(2007-0-22)' and issuedate <= 'strtotime(2008-02-27)'
the below error received:
Server: Msg 241, Level 16, State 1, Line 1
Conversion failed when converting datetime from character string.
please advice
select * from cutheader where issuedate >= 'strtotime(2007-0-22)' and issuedate <= 'strtotime(2008-02-27)'
the below error received:
Server: Msg 241, Level 16, State 1, Line 1
Conversion failed when converting datetime from character string.
please advice
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
receiving the below error:
Server: Msg 195, Level 15, State 10, Line 1
'date' is not a recognized built-in function name.
Server: Msg 195, Level 15, State 10, Line 1
'date' is not a recognized built-in function name.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i tried this also but still receiving an error:
Server: Msg 195, Level 15, State 10, Line 1
'strtotime' is not a recognized built-in function name.
Server: Msg 195, Level 15, State 10, Line 1
'strtotime' is not a recognized built-in function name.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Server: Msg 243, Level 16, State 1, Line 1
Type date is not a defined system type.
Server: Msg 243, Level 16, State 1, Line 1
Type date is not a defined system type.
Type date is not a defined system type.
Server: Msg 243, Level 16, State 1, Line 1
Type date is not a defined system type.
ASKER
still receiving error
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
how do i check the version?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
anqelll, its working thanks all
so from this..
select * from cutheader where issuedate between '2007-0-22' and '2008-02-27'
to this most probable..
select * from cutheader where issuedate >= 'strtotime(2007-0-22)' and issuedate <= 'strtotime(2008-02-27)'
please refer to http://php.net/manual/en/function.strtotime.php
BR
Frozenice