Link to home
Start Free TrialLog in
Avatar of skyler99
skyler99

asked on

ASP / Incorrect syntax near '#' in Between SQL statement

Hello

ASP ---> I keep getting an error page message. The code doesn't seem to parse or the syntax is incorrect.  Do you know what may be wrong in "Between" statement.  It connects to a SQL Sever DB and I know it checks the tags first ... I don't thinks that I miss place one.  

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#'.


  strSQL="Select * From SQLTbl "
   strSQL=strSQL & " Where [call date] between "
   strSQL=strSQL & "#" & varGetStartDate & "# and #" & varGetEndDate & "#"
     
   Response.Write "<HR>" & strSQL & "<HR>"
   
   rs.Open strSQL, conn, adOpenStatic

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial