Comparision of Dates in SQL Server - TechRepublic
General discussion
May 22, 2001 at 05:36 AM
ssingh

Comparision of Dates in SQL Server

by ssingh . Updated 25 years, 1 month ago

I gave a query where there was comparison operator used with datetime. If i gave a Date in ‘MDY’ format output is as expected , but with ‘DMY’ format same query is yielding undesirable output.
Query is as Follows
— MDY
SELECT * FROM CALL_DETAILS
WHERE convert (varchar,cal_opn_dt_time,101) < '05/22/2001' --DMY SELECT * FROM CALL_DETAILS WHERE convert (varchar,cal_opn_dt_time,103) < '22/05/2001' Please tell me solution for the same as I wanna use this query for 2 Formats 'MDY' and 'DMY'in Procedure. 'Sanjeev'

This discussion is locked

All Comments