Michael,

You're using SQL... is your 'TicketPassedOff' field a selection field? 
Those are stored in the database as integers.

Also, you say 'TicketPassedOff' is a temp field.  If it is display only, 
then no value will be stored in the DB.  But then I guess you say you 
aren't getting any syntax errors, so the column probably is being stored. 
Okay, go back to my first thought.

Thad Esser
Remedy Developer
"Argue for your limitations, and sure enough, they're yours."-- Richard 
Bach



"McManus Michael A SSgt HQ 754 ELSG/DOMH" <[EMAIL PROTECTED]> 
Sent by: "Action Request System discussion list(ARSList)" 
<arslist@ARSLIST.ORG>
07/26/2007 01:19 PM
Please respond to
arslist@ARSLIST.ORG


To
arslist@ARSLIST.ORG
cc

Subject
More SQL Help






** 
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
 
__20060125_______________________This posting was submitted with HTML in 
it___ 

***IMPORTANT NOTICE: This communication, including any attachment, contains 
information that may be confidential or privileged, and is intended solely for 
the entity or individual to whom it is addressed.  If you are not the intended 
recipient, you should delete this message and are hereby notified that any 
disclosure, copying, or distribution of this message is strictly prohibited.  
Nothing in this email, including any attachment, is intended to be a legally 
binding signature.***

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the 
Answers Are"

Reply via email to