|
-
Sep 1st, 2000, 05:17 AM
#1
Thread Starter
Junior Member
I am trying to write an sql that will take 2 dates from a drop down date picker box and perform an sql on a database to bring back the data logged between the dates. Can anyone help?
-
Sep 1st, 2000, 05:37 AM
#2
New Member
Without going into parameter collections and such, you could try creating a text string that contains the SQL command.
The string would look something line this
strSelect = "Select * From table1 " _
& "where Date Between " & txtStartDate.text _
& " And " & txtEndDate.text
Then when you open your recordset, use strSelect as the source string.
Hope this helps
-
Sep 1st, 2000, 07:01 AM
#3
Lively Member
You could also try the DateValue function, I found this worked for me when specifying dates.
For example
SQLStatement = "SELECT [Records] From [Table] WHERE [ThisField] between DateValue('" & StartDate & "') and DateValue('" & EndDate & "')"
Cheers
Adrian
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|