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

Hard Sorting and Grouping Question

Status
Not open for further replies.

snyperx3

Programmer
May 31, 2005
467
US
I have a query that contains these fields:
=================
ID
Opened Date
Status
2weekDate
2weekPerson
4weekDate
4weekPerson
6weekDate
6weekPerson
=================

This query pulls data from a table that contains Issues by ID, and the #weekDate/Person contains the date and person that sent a notification. Now if the database is closed for a while and then run again, it is possible for them to send notifications on the 4week and never send them on the 2week. So im saying that some of these #week fields can contain nothing.

In my report I have to display all the issues that have had notifications sent, but i need to group them by the last time they were notified. Such as:

-Report-

2 week Issues
....

4 week Issues
....

6 week Issues
....

-End Report-

None of the issues should be displayed twice. So if they had notification sent on 2 weeks and on 4 weeks, it should only show on the 4 weeks.

Is this at all possible?

-Pete
 
Never Mind. I adjusted the query to work better for me. If anyone else comes across this issue, here is my updated query:

SELECT Issues.ID, Issues.[Opened Date], Issues.Status, IIf(Not IsNull([6weekPerson]),[6weekPerson],IIf(Not IsNull([4weekPerson]),[4weekPerson],[2weekPerson])) AS Person, IIf(Not IsNull([6weekPerson]),6,IIf(Not IsNull([4weekPerson]),4,2)) AS Week, IIf(Not IsNull([6weekPerson]),[6weekDate],IIf(Not IsNull([4weekPerson]),[4weekDate],[2weekDate])) AS DateSent, Issues.[Problem Description], Contacts.[First Name] & " " & contacts.[Last Name] AS Assignee
FROM Contacts INNER JOIN Issues ON Contacts.ID = Issues.[Assigned To]
WHERE (((Issues.Status)<>"Closed") AND ((IsNull([2weekPerson]))=False)) OR (((IsNull([4weekPerson]))=False)) OR (((IsNull([6weekPerson]))=False));

-Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top