hidrau
asked on
how can I make a query filtering with date and time?
this way
SELECT * FROM TABLE
WHERE DATE_ORDER >= 07-02-2013 09:00 and DATE_ORDER <= 07-02-2013 09:30
|Thanks
Alex
SELECT * FROM TABLE
WHERE DATE_ORDER >= 07-02-2013 09:00 and DATE_ORDER <= 07-02-2013 09:30
|Thanks
Alex
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your data type of DATE_ORDER is smalldatetime?
select * from table where date_order between CAST('07-02-2013 09:00' AS smalldatetime) and CAST('07-02-2013 09:30' AS smalldatetime);
select * from table where date_order between CAST('07-02-2013 09:00' AS smalldatetime) and CAST('07-02-2013 09:30' AS smalldatetime);
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks everybody
ASKER
The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.