Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with ACCESS Queries

Status
Not open for further replies.

m3hosting

MIS
May 10, 2001
8
US
I am using VBA ASP pages to access an ACCESS database. I am having problems using dates.

My code is as follows, indate comes from a form.

indate=trim(request.form("indate"))
set RS objConn.execute("Select * FROM Dumps WHERE Date = #indate#")

Any help would be great. This date thing is killing me.
 
in your code, you aren't concat the indate field, and you're missing the = sign.

it should look like:

indate=trim(request.form("indate"))
set RS = objConn.execute("Select * FROM Dumps WHERE Date = #" &indate& "#")

Hope this clears it up for you...
 
Ok what if I want to do a range of dates. Like indate1 and indate2.

I find help your wuite refreshing. I have tried for three days to wokr this out. I am a mainframe assembler programmer.
 
you could change your sql string to look like this

Code:
set RS = objConn.execute("Select * FROM Dumps WHERE Date BETWEEN #" &indate1& "# AND #" &indate2& "#")

This way, the recordset you return will be between the ranges of indate1 and indate2. There are other ways that you can do this as well, but this would be the most efficient.

Whenever you have an ASP problem, feel free to post it in this forum. Chances are, that someone here will be able to help you figure out the answer.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top