Results 1 to 2 of 2

Thread: wont let me query dates

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    North East (UK)
    Posts
    204

    Smile

    Hi all,
    I am trying to run a query to find all dates in a given period using 2 DTPickers. I can manage ok when only using 1 DTPicker but I can't seem to get it using the BETWEEN method. Here is a the piece of code I am trying:

    Dim fd As Date
    Dim ld As Date
    Dim wt As String
    fd = DTPicker1.Value
    ld = DTPicker2.Value
    wt = cmbWatch.Text

    rsAllDates.Open "SELECT * FROM Staff_Dets
    WHERE Date_From BETWEEN('" & fd & "' And '" & ld & "')
    AND Location_Code = '" & lc & "'"

    Cheers

  2. #2
    Hyperactive Member barrk's Avatar
    Join Date
    Sep 2000
    Location
    My own little world
    Posts
    274
    remove the tick marks around the dates

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