Click to See Complete Forum and Search --> : Dates


chakri_m16
May 9th, 2001, 06:39 AM
when iam trying to delete records between two of different months its not deleting.

This is the code used :

If MsgBox(" Do You Want To Delete ", vbQuestion + vbYesNo, " DELETE BY DATE ") = vbYes Then
db.Execute "Delete from CTRAN where FWDate >='" & fdt.Text & "' And SWDate <='" & sdt.Text & "'"
MsgBox db.RecordsAffected & " Records Deleted "

This is deleting records between two diff dates of the same month.please help me out.

Iouri
May 9th, 2001, 07:04 AM
Your SQl must be

"Delete from CTRAN where FWDate >=#" & cDate(fdt.Text) & "# And SWDate <=#" & CDate(sdt.Text) & "#"


Iouri Boutchkine
iouri@hotsheet.com