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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Someone Correct Me

Status
Not open for further replies.

SHARKY99

Programmer
Oct 25, 2001
473
CA
Hi all, i'm writing an ASP code which uses SQL in a Query.

The problem is i must use a variable in my query but it doesn't work? There must be an error in my code but i don't have the time to play with it.

I've generated my code in Access and made a few changes....

Here is my code
Code:
TstDatStart = 11/1/2001
TstDatEnd = 11/21/2001
set dbReserv= server.createObject("ADODB.Connection")
set rsHorCou=server.createObject("ADODB.Recordset")
dbReserv.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("..") & "/dbs/BDReservation.mdb"
vSql=&quot;SELECT QryB1204.Date, QryB1204.[8h00], QryB1204.[8h30], QryB1204.[9h00], QryB1204.[9h30], QryB1204.[10h00], QryB1204.[10h30], QryB1204.[11h00], QryB1204.[11h30], QryB1204.[12h00], QryB1204.[12h30], QryB1204.[13h00], QryB1204.[13h30], QryB1204.[14h00], QryB1204.[14h30], QryB1204.[15h00], QryB1204.[15h30], QryB1204.[16h00], QryB1204.[16h30], QryB1204.[17h00], QryB1204.[17h30], QryB1204.[18h00], QryB1204.[18h30], QryB1204.[19h00], QryB1204.[19h30], QryB1204.[20h00], QryB1204.[20h30], QryB1204.[21h00], QryB1204.[21h30], QryB1204.[22h00], QryB1204.[22h30] FROM QryB1204 WHERE (((QryB1204.Date)>#'&quot; & TstDatStart & &quot;'# And (QryB1204.Date)<#'&quot; & TstDatEnd & &quot;'#)) ORDER BY QryB1204.Date;&quot;

Thanks in advance

Sharky99 >:):O>
 
Ok i got it....


>#&quot; & TstDatStart & &quot;# And (QryB1204.Date)<#&quot; & TstDatEnd & &quot;#


Sharky99 >:):O>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top