Counting days in a group by query less than....

C

Coach K

I am trying to get the following SQL statement to work but everytime I run it
i get the message that "its is to complex"

here is the statement:

SELECT Format([REC_DATE],"yyyy\-mm") AS TheMonth, Count([TAT-TOTAL]) AS
[CountOfTAT-TOTAL]
FROM [qryFGD-SOUTHERN-RES-AE]
WHERE [TAT-TOTAL] <= 15
GROUP BY Format([REC_DATE],"yyyy\-mm");



Thanks for your help in advance!!
 
J

Jeff Boyce

Have you tried stripping out pieces until it does work, then building back
up to identify what's confusing Access?

Another approach might be to build a "chain" of queries, each one using the
previous query's result as the source? That way you could do the simplest
pieces first, then add complexity in subsequent query(ies).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
R

raskew via AccessMonster.com

Here's a working example (based on Northwind's Orders table) built using the
query designer. Note the WHERE vs HAVING difference.

SELECT Format([OrderDate],"yyyy-mm:") AS theMonth, Count(Orders.OrderID) AS
CountOfOrderID
FROM Orders
GROUP BY Format([OrderDate],"yyyy-mm:")
HAVING (((Count(Orders.OrderID))<30));

Bob

Coach said:
I am trying to get the following SQL statement to work but everytime I run it
i get the message that "its is to complex"

here is the statement:

SELECT Format([REC_DATE],"yyyy\-mm") AS TheMonth, Count([TAT-TOTAL]) AS
[CountOfTAT-TOTAL]
FROM [qryFGD-SOUTHERN-RES-AE]
WHERE [TAT-TOTAL] <= 15
GROUP BY Format([REC_DATE],"yyyy\-mm");

Thanks for your help in advance!!
 
J

John Spencer

I suspect that qryFGD-SOUTHERN-RES-AE is generating an error in one or
more the results for Rec_Date and when you trying formatting that in
this query you are getting the Too Complex error.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
Top