Why does the grouping in this query not work?

M

mscertified

SELECT RecordDate, RecordType, Sum(HowMany) AS [Num]
FROM qrySummary1
GROUP BY RecordDate, RecordType;

This query refuses to do the grouping. Is it because one of the columns is a
date?
 
M

mscertified

With this it refuses to group (I get all individual records):
SELECT RecordDate, RecordType, sum(HowMany) AS Num
FROM tblAddress
WHERE RecordDate Between NZ([forms]![frmPrint]![StartDate],#1/1/1901#) And
NZ([forms]![frmPrint]![EndDate],#1/1/2999#)
GROUP BY RecordDate, RecordType;

With this it does group:
SELECT RecordDate, RecordType, sum(HowMany) AS Num
FROM tblAddress
WHERE RecordDate Between #1/1/1901# And #1/1/2999#
GROUP BY RecordDate, RecordType;

I'm using Access 2003. Any idea why?



Douglas J. Steele said:
What do you mean by not working? What do you get?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


mscertified said:
SELECT RecordDate, RecordType, Sum(HowMany) AS [Num]
FROM qrySummary1
GROUP BY RecordDate, RecordType;

This query refuses to do the grouping. Is it because one of the columns is
a
date?
 
M

mscertified

I plugged away at this some more and I've discovered a weird thing: the query
is grouping up to a certain date then it stops grouping. I have never seen
anything like this before.
Any idea what could cause this? All dates before 6/28/07 group correctly. On
6/28/07 and after, all dates and record types are listed individually.

Douglas J. Steele said:
What do you mean by not working? What do you get?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


mscertified said:
SELECT RecordDate, RecordType, Sum(HowMany) AS [Num]
FROM qrySummary1
GROUP BY RecordDate, RecordType;

This query refuses to do the grouping. Is it because one of the columns is
a
date?
 
M

mscertified

It was the table!
I set up a new table and copied over all the data and now it works ok.

Douglas J. Steele said:
What do you mean by not working? What do you get?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


mscertified said:
SELECT RecordDate, RecordType, Sum(HowMany) AS [Num]
FROM qrySummary1
GROUP BY RecordDate, RecordType;

This query refuses to do the grouping. Is it because one of the columns is
a
date?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top