Listers,
I'm running into more problems with SQL so I figured I'd check here
again. Here's the initial query:
SELECT COUNT(*) AS Total
FROM Session_Tracking
WHERE Incident_ID = '$Incident_Number$' AND PassOffReason IS NOT NULL
This works perfectly. When the user tabs over to the Misc. Tab, the
Total_Session_PassOffs field is set to the correct number.
I got two additional requirements to add to this query. The first is to
eliminate sessions where PassOffReason = 'Update' so I added the following to
the query:
AND PassOffReason != 'Update'
This also works perfectly. The final requirement was to count sessions where
the ticket was passed to Sys POC Working status, but the user didn't select a
reason. What I did was create a temp field on the incident and session form
called TicketPassedOff which is set to 'Yes' when the ticket changes from
Helpdesk Working to Sys POC Working. The set field, and accompanying clear
fields action works, as well as the push fields action over to the session
tracking form. I want the Total_Session_PassOffs field to be set with the
total number of passoffs to include when the TicketPassedOff field = 'Yes' so
my final query looks like this:
SELECT COUNT(*) AS Total
FROM Session_Tracking
WHERE Incident_ID = '$Incident_Number$' AND (PassOffReason IS NOT NULL OR
TicketPassedOff = 'Yes') AND PassOffReason != 'Update'
I thought the OR clause would make the enclosed section evaluate to True when
either or both of those arguments evaluate to true but it doesn't seem to be
working. I don't get any syntax errors, but it's not counting the sessions
where TicketPassedOff = 'Yes' and PassOffReason is null.
Thanks much,
Michael A. McManus, SSgt, USAF
Remedy Developer
HQ 754 ELSG/DOMH
DSN: 596-6478 / Comm: 334-416-6478
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the
Answers Are"