Results 1 to 2 of 2

Thread: Date query with VB6 and ACCESS 2003

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Location
    Belgium, Feluy
    Posts
    15

    Date query with VB6 and ACCESS 2003

    Hello,

    I use VB6 and MS ACCESS2003. I would like to run a query that find records between 2 date. The date are entered through textbox control with format set to date (dd/MM/yyyy). I don't find the correct syntax to run that query. My code looks like :

    "(StartDate >= DateValue(txtStartDate.Txt) AND EndDate <= DateValue(txtEndDate.Text))"

    Any Idea ????

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Date query with VB6 and ACCESS 2003

    There is an article about this in our Database FAQs (link in my signature).

    What you should have is something like this:
    VB Code:
    1. "(StartDate >= #" & txtStartDate.Txt & "# AND EndDate <= #" & txtEndDate.Text & "#)"

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