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 ????
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:
"(StartDate >= #" & txtStartDate.Txt & "# AND EndDate <= #" & txtEndDate.Text & "#)"