I am working on designing a asp form which will query an Access database (mdb). The outcome of the form is to query data results between a date range (date from and date to), and output the results on the asp page below. When I try and run the query I receive the following error:
Microsoft JET Database Engine error '80040e07' Syntax error in date in query expression 'name = 'firstname.lastname' And date = ##'.
Note: firstname.lastname correspnds to the real person.
The code it points to two lines which appear as follows:
rstDATA.open "Select * From xxx Where name = '" & username & "' And date = #" & request.Form("ddDate") & "#",cnn, adOpenKeyset, ,adLockReadOnly %>
rstDATA.open "Select * From xxx Where name = '" & username & "' And date = #" & request.Form("ddDate") & "#",cnn, adOpenKeyset, ,adLockReadOnly %>
where xxxx corrsponds to the table.