originalxavier
Programmer
Hello,
I have a database with several tables and fields and I am trying to set up a form that will pull data by the "Problem Type" (which currently works) but only show resposes within a certain Date Range that the user will have to enter. I currently have inputboxes that request the dates, and I have these Dim'ed as Strings. But when I try to build on the functional code to add a date range, I get a syntax error for a missing operator in query expression... Here is some code...
I have a database with several tables and fields and I am trying to set up a form that will pull data by the "Problem Type" (which currently works) but only show resposes within a certain Date Range that the user will have to enter. I currently have inputboxes that request the dates, and I have these Dim'ed as Strings. But when I try to build on the functional code to add a date range, I get a syntax error for a missing operator in query expression... Here is some code...
Code:
startdate = InputBox("Please enter a start date (yyyy-mm-dd)")
startdate = Format(startdate, "yyyy-mm-dd")
enddate = InputBox("Please enter an end date (yyyy-mm-dd)")
enddate = Format(enddate, "yyyy-mm-dd")
strSQL = "SELECT Actions.RequestNo..."
..."WHERE ((Actions.DateEntered) Between '" & startdate & "' " & _
"And '" & enddate & "')"
Any help would be appreciated...
Thanks in advance Xavier
----------------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning."
Rich Cook
----------------------------------------