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!

One more question about this report you folks built me :-)

Status
Not open for further replies.

herbal

Programmer
Jul 10, 2003
36
US
I need to just add a count of records by group. To be more specific I need a count of added records, and a count of expired records.

Here's the SQL statement:

SELECT 'Expired' As [Type], ExpiredMembers.FirstName, ExpiredMembers.MiddleName, ExpiredMembers.LastName, ExpiredMembers.DateUpdated, ExpiredMembers.MemberID, #1/1/1900# As DateJoined, #1/1/1900# AS DateExpired, ExpiredMembers.DL AS [TDL\DL]
FROM ExpiredMembers
WHERE (((ExpiredMembers.DateUpdated)>=[Retrieve deleted members since what date?] And (ExpiredMembers.DateUpdated)<=[date?]))
UNION SELECT 'Added' AS [Type], Members.FirstName, Members.MiddleName, Members.LastName, NULL As DateUpdate, Members.MemberID, Members.DateJoined, Members.DateExpired, Members.TDL AS [TDL\DL]
FROM Members
WHERE (((Members.DateJoined)>=[Retrieve new members since what date?] And (Members.DateJoined)<=[date?]))
ORDER BY Type DESC , MemberID;

Thanks
Herbal
 
To count the Expired values:
=Sum(Abs([Type]="Expired"))
Do something similar for Added.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top