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

Problem with filter in HAVING using Access and ColdFusion

Status
Not open for further replies.

danpatch

Technical User
Dec 3, 2000
2
US
I am having a puzzling problem with an Access SQL query, and I wondered if anyone had any ideas.

My original query (which executes fine from both ColdFusion and the machine running the database) was:

SELECT Tracking.ViewDate, Firm_IPs.Firm, Articles.Title, Count(Articles.Title) AS CountOfTitle
FROM (Articles INNER JOIN Tracking ON Articles.ID = Tracking.ArticleNo) INNER JOIN Firm_IPs ON Tracking.ClientIP = Firm_IPs.IP
GROUP BY Tracking.ViewDate, Firm_IPs.Firm, Articles.Title
HAVING (((Tracking.ViewDate) Between #SDate# And #EDate#))
ORDER BY Tracking.ViewDate DESC , Firm_IPs.Firm, Count(Articles.Title) DESC;

However, when I attempt to add a filter to the Firms_IP.Firms column as follows, I get the ODBC error message below:

SELECT Tracking.ViewDate, Firm_IPs.Firm, Articles.Title, Count(Articles.Title) AS CountOfTitle
FROM (Articles INNER JOIN Tracking ON Articles.ID = Tracking.ArticleNo) INNER JOIN Firm_IPs ON Tracking.ClientIP = Firm_IPs.IP
GROUP BY Tracking.ViewDate, Firm_IPs.Firm, Articles.Title
HAVING (((Tracking.ViewDate) Between #SDate# And #EDate#) AND ((Firm_IPs.Firm) Like "Aker*"))
ORDER BY Tracking.ViewDate DESC , Firm_IPs.Firm, Count(Articles.Title) DESC;

Error Occurred While Processing Request
Error Diagnostic Information
ODBC Error Code = 07001 (Wrong number of parameters)


[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

Hint: The cause of this error is usually that your query contains a reference to a field which does not exist. You should verify that the fields included in your query exist and that you have specified their names correctly.


The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (17:1) to (19:18).


Any ideas? I don't understand how I could be refernecing a field that does not exist when the original (which functioned perfectly) references the same field, although not via a HAVING.
 

You need to be aware that Cold Fusion replaces the ODBC drivers with it's own during installation.

There are other problems that you will encounter with it's use on NT and IIS. Some documented, some not.

You should post your question at the 'Cold Fusion' forum at this site. Many (many, many) other CF developers wrestle with problems of this type and may have the answers that you need.

Amiel
amielzz@netscape.net

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top