Christine Pearc
Christine
- Local time
- Today, 06:24
- Joined
- May 13, 2004
- Messages
- 111
I just can’t seem to get the hang of writing queries hope someone can help me figure out what to put where in the query design grid. I feel pretty dumb not being able to figure it out, especially since my boss wants a report asap
.
What I need to do is to figure out how many CARs (corrective action requests) for each process are pending, how many have been pending for over 7 working days, and how many have been issued for action, and how many have action dates that are overdue.
TABLE FIELDS:
ProcessID
DateOpened
Status: Values are 1-Requested, 2-Issued, 3-Rejected, 4-Incident, 5-Closed
ReviewDate
TargetDate
ClosedDate
CRITERIA FOR EACH COLUMN:
Below is the English for what I want and my feeble attempt to use Access terminology to get the required results. I’m certain that, not only is the coding wrong, but I really don’t understand how it should look in the query design grid.
Column1 - ProcessID: No criteria required – just list the processes and info for columns 2-4.
Column2 - # CARs Pending Review - The CAR has been open for less than 7 working days and the ReviewDate is blank:
StatusID =1 and DateDiff("d",[DateOpened],[DispositionDate] <7
working days
Column3 - # CARs Review Overdue - The CAR has been open more than 7 working days and the ReviewDate is blank (null):
StatusID=1 and DateDiff("d",[DateOpened],[DispositionDate]>7
working days
Column4 - # CARs Issued for Action – The CAR has been issued for action and the target date hasn’t been passed:
StatusID=2 and TargetDate<Date()
Column 5 - # CARs Action Overdue: The CAR has been issued and the target date has come and gone:
StatusID=2 and Date() > TargetDate
--------------
Thanks in advance,
Christine
What I need to do is to figure out how many CARs (corrective action requests) for each process are pending, how many have been pending for over 7 working days, and how many have been issued for action, and how many have action dates that are overdue.
TABLE FIELDS:
ProcessID
DateOpened
Status: Values are 1-Requested, 2-Issued, 3-Rejected, 4-Incident, 5-Closed
ReviewDate
TargetDate
ClosedDate
CRITERIA FOR EACH COLUMN:
Below is the English for what I want and my feeble attempt to use Access terminology to get the required results. I’m certain that, not only is the coding wrong, but I really don’t understand how it should look in the query design grid.
Column1 - ProcessID: No criteria required – just list the processes and info for columns 2-4.
Column2 - # CARs Pending Review - The CAR has been open for less than 7 working days and the ReviewDate is blank:
StatusID =1 and DateDiff("d",[DateOpened],[DispositionDate] <7
working days
Column3 - # CARs Review Overdue - The CAR has been open more than 7 working days and the ReviewDate is blank (null):
StatusID=1 and DateDiff("d",[DateOpened],[DispositionDate]>7
working days
Column4 - # CARs Issued for Action – The CAR has been issued for action and the target date hasn’t been passed:
StatusID=2 and TargetDate<Date()
Column 5 - # CARs Action Overdue: The CAR has been issued and the target date has come and gone:
StatusID=2 and Date() > TargetDate
--------------
Thanks in advance,
Christine