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'