bhakti_thakkar
02-13-2009, 05:51 AM
hi,
i want to find a records that are between two dates including both the dates. below is my query but it doesnt works. no error message but the relevent record doesnt come even if the date is matching the condition. datatype of that field is datetime.
select t.TransactionCertificate_ID , t.DateOfIssue_DT , t.Project_ID , t.ITCType_TI from TransactionCertificate_T t where t.DateOfIssue_DT is not null and t.Deleted_DT is null and (t.TNTDHLtrackcode_VC ='' or t.TNTDHLtrackcode_VC is null) and ( t.DateOfIssue_DT between '02-12-09' and '02-12-09') order by t.DateOfIssue_DT
what is the problem. below is the record in the DB
29768 2009-02-12 16:28:04.000 4233 Organic EU2092/91 1
29801 2009-02-12 16:51:20.000 382 JAS 1
Please help if i give the date range as 02-12-09 and 02-13-09 it works but not when i give between '02-12-09' and '02-12-09'.
Thanks in advance
i want to find a records that are between two dates including both the dates. below is my query but it doesnt works. no error message but the relevent record doesnt come even if the date is matching the condition. datatype of that field is datetime.
select t.TransactionCertificate_ID , t.DateOfIssue_DT , t.Project_ID , t.ITCType_TI from TransactionCertificate_T t where t.DateOfIssue_DT is not null and t.Deleted_DT is null and (t.TNTDHLtrackcode_VC ='' or t.TNTDHLtrackcode_VC is null) and ( t.DateOfIssue_DT between '02-12-09' and '02-12-09') order by t.DateOfIssue_DT
what is the problem. below is the record in the DB
29768 2009-02-12 16:28:04.000 4233 Organic EU2092/91 1
29801 2009-02-12 16:51:20.000 382 JAS 1
Please help if i give the date range as 02-12-09 and 02-13-09 it works but not when i give between '02-12-09' and '02-12-09'.
Thanks in advance