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

parameter problem in excel query

Status
Not open for further replies.

flaviooooo

Programmer
Joined
Feb 24, 2003
Messages
496
Location
FR
Hi there,

I have this query in Excel 97 (MSQuery). I want to replace the years (2003 and 2002) by a parameter. But when I replace the years in my SQL statement by a '?' or '[Give year]', it gives me the 'Too few Parameters, expected 1' error...
Any ideas?

SELECT Year(DATUM), Month(DATUM), Left(MACHINE,4), Sum(PRODUCTIE.STILNTLHR)
FROM `C:\Nacalculatie`.PRODUCTIE PRODUCTIE
GROUP BY Year(DATUM), Month(DATUM), Left(MACHINE,4), (Year(DATUM)), (Month(DATUM))
HAVING ((Year(DATUM))=2003) AND ((Month(DATUM))<7) AND ((Sum(PRODUCTIE.STILNTLHR))<>0) OR ((Year(DATUM))=2002) AND ((Month(DATUM))>6)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top