Jiri, It looks much cleaner, and it works, so thanks a bunch, but I still don't understand why (PassOffReason IS NOT NULL OR TicketPassedOff = 'Yes') doesn't work. It seems like if I want it to be counted if either of those arguments is true, then that would be the way to do it.
It's a good thing this list is around. I'd never get anything done :) Michael A. McManus, SSgt, USAF Remedy Developer HQ 754 ELSG/DOMH DSN: 596-6478 / Comm: 334-416-6478 -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Jiri Pospisil Sent: Friday, July 27, 2007 7:47 AM To: arslist@ARSLIST.ORG Subject: Re: More SQL Help Michael, looking at your condition and description of what you are trying to achieve, should not the condition be ... PassOffReason IS NULL AND ... rather than ... PassOffReason IS NOT NULL AND ... In addition, I would also try changing the WHERE clause to read something like: WHERE Incident_ID = '$Incident_Number$' AND ((PassOffReason IS NULL AND TicketPassedOff = 'Yes') OR (PassOffReason IS NOT NULL AND PassOffReason != 'Update')) Hope this helps Regards Jiri Pospisil Technology Support Systems ▪T▪ ▪ ▪Mobile UK▪ -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of McManus Michael A SSgt HQ 754 ELSG/DOMH Sent: 27 July 2007 13:27 To: arslist@arslist.org Subject: Re: More SQL Help It's a character field I created and I'm setting the value literally to "Yes" Temp field maybe wasn't the best way to state that. Hidden workflow field would be better. Michael A. McManus, SSgt, USAF Remedy Developer HQ 754 ELSG/DOMH DSN: 596-6478 / Comm: 334-416-6478 -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Thad K Esser Sent: Thursday, July 26, 2007 6:36 PM To: arslist@ARSLIST.ORG Subject: Re: More SQL Help ** 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.*** __20060125_______________________This posting was submitted with HTML in it___ _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are" T-Mobile (UK) Limited Company Registered Number: 02382161 Registered Office Address: Hatfield Business Park, Hatfield, Hertfordshire, AL10 9BW Registered in England and Wales NOTICE AND DISCLAIMER This email (including attachments) is confidential. If you are not the intended recipient, notify the sender immediately, delete this email from your system and do not disclose or use for any purpose.