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

Access UNION query in ASP

Status
Not open for further replies.

stevetektip

Programmer
Oct 17, 2002
6
US
Hi all,
I've got a Union query that works fine in Access 2000, but when I run the query in an ASP file (MDAC 2.7 using ODBC connection to mdb file) I get the error:
---------------------------------------
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
---------------------------------------
I didn't find anyting in the MS knowledge base about this type of query either.

Here's the query...
---------------------------------------
select feature_id, 1 as phase from projects where (datediff("m",#9/10/2003#,demo_start) >6)
union
select feature_id, 2 as phase from projects where (datediff(&quot;m&quot;,#9/10/2003#,demo_start) <=6) and (datediff(&quot;m&quot;,#9/10/2003#,demo_start) >0)
---------------------------------------
Rather simple, works fine in Access 2000, but crashes & burns when run with ASP.

Any suggestions would be greatly appreciated.
Thanks!
 
my unprofessional quess - get rid of double quotes & use single ones

select feature_id, 1 as phase from projects where (datediff('m',#9/10/2003#,demo_start) >6)
 
Thanks martiros, that was the problem - the string needed single quote instead of double quote.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top