CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Dates

  1. #1
    Join Date
    Apr 2001
    Location
    Andhra Pradesh,INDIA
    Posts
    11

    Dates

    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.


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Dates

    Your SQl must be

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


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured