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!

QofQ - Incorrect select list...

Status
Not open for further replies.

nohandlesleft254

IS-IT--Management
Apr 19, 2006
58
GB
Hi,

I have a main query that i use to get all invoices for the last 6/12/18/24 months. I am then trying to use QofQ to obtain the information for the months individually, but i get an error;

*Query Of Queries syntax error.
Encountered "Date. Incorrect Select List, Incorrect select column,*

but Date clearly is in the query?... what am i missing?

Main Query-
<cfquery name="FindUsageLevels" datasource="#Application.HansaData#">
SELECT
SerNr,
CONVERT(DATETIME, OrdDate, 103) AS Date,
CAST(Sum4 AS MONEY) AS Sum4
FROM SALESORDERS
WHERE Sum4 <> ''
AND CONVERT(DATETIME, OrdDate, 103) BETWEEN '#FromDate#' AND '#LASTDAYTHISMONTH#'
</cfquery>

First QofQ -
<cfquery name="Month11" dbtype="query">
SELECT
Date,
SUM(Sum4) AS MonthTotal
FROM FindUsageLevels
WHERE Date BETWEEN '#FIRSTDAYTHISMONTH11#' AND '#LASTDAYTHISMONTH11#'
</cfquery>
 
What database are you using? DATE may be a reserved word, try changing it to something else.


Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top