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

Need help with a groupby query 1

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I need to create a query that shows totals for certain fields. I have a field called "Releaseddate" in my query i made it a groupby and did a count on a certain field with the releasedate = #08/22/01#....works fine..but i need to create another query the same way but in this one i need the releasedate = is null.. in the criteria of the releasedate field i entered it a few different ways but it wont work...I entered #08/22/01# And Is Null...that did not work...I entered #08/22/01# Is Null that did not work...

basically I need to see on the records that have a releasedate = Null on any day i choose. But it has to count the field that I need...I posted the SQL Statement below..

Thanks


SELECT [Laboratory Drums].releasedate, Count([Laboratory Drums].sampleno) AS CountOfsampleno, [Laboratory Drums].sample_type
FROM [Laboratory Drums]
GROUP BY [Laboratory Drums].releasedate, [Laboratory Drums].sample_type
HAVING ((([Laboratory Drums].releasedate)=#8/22/2001#));
DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
Please explain what you mean by...

"basically I need to see on the records that have a releasedate = Null on any day i choose"

The releasedate field will = a specific day or it will be null. Are you trying to find all the records where the releasedate is null?? If so then

HAVING ((([Laboratory Drums].releasedate) is null));

should work. Maq B-)
<insert witty signature here>
 
no i want to be prompted to enter a date and have it show me all the records = releasedate=null for which date a enter when it prompts me...again this is a groupby query that does a count of a field..

Thanks DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
Sorry, but I still don't understand. Which field will contain the date that you enter at the prompt? ReleaseDate? If so, then ReleaseDate cannot possibly = both Null and the date that you enter.

Does another field, say Date2, equal the date you enter. If so then you need to write your query to group by Date2 where ReleaseDate is Null.

I hope that helps some. Maq B-)
<insert witty signature here>
 
im so sorry ...your right..it's friday and i've been working on this dam project for about 5 weeks now...it's time to create all the reports and it's driving me crazy..
it was my error


Thanks DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top