Joe, You were having a bad day yesteray ;)
SELECT COUNT(*) AS Total FROM Session_Tracking WHERE Incident_ID = '$Incident Number$' AND PassOffReason IS NOT NULL Fred -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Joe D'Souza Sent: Thursday, July 19, 2007 7:01 PM To: arslist@ARSLIST.ORG Subject: Re: SQL help I stand corrected.. I was leaving work when I wrote my last mail and hurried through it.. this should work.. SELECT COUNT(*) AS Total FROM Session_Tracking WHERE Incident_ID = '$Incident Number$' IS NOT NULL AND PassOffReason IS NOT NULL Joe -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] Behalf Of Mike Wallick Sent: Thursday, July 19, 2007 6:25 PM To: arslist@ARSLIST.ORG Subject: Re: SQL help You might also try giving the count(*) a name so there is a "column" to reference. e.g. SELECT COUNT(*) AS Total FROM Session_Tracking WHERE Incident_ID = Incident_Number IS NOT NULL AND PassOffReason IS NOT NULL Just a thought. Mike On 7/19/07, Joe D'Souza <[EMAIL PROTECTED]> wrote: > ** > > > > Try > > > > SELECT COUNT(*) > > FROM Session_Tracking > > WHERE Incident_ID = Incident_Number IS NOT NULL AND PassOffReason IS > NOT NULL > > > > Joe > > -----Original Message----- > From: Action Request System discussion list(ARSList) > [mailto:[EMAIL PROTECTED] Behalf Of McManus Michael A SSgt HQ 754 > ELSG/DOMH > Sent: Thursday, July 19, 2007 4:47 PM > To: arslist@ARSLIST.ORG > Subject: SQL help > > ** > > > So I stink and SQL and I imagine it's a syntax error so I figured I'd > check here. We have a field on our incident form that tracks the > total number of passoffs a ticket goes through. Currently it's not > working so I'm trying to make it happen. Here's the SQL I'm trying to use. > > > > SELECT COUNT(*) > > FROM Session_Tracking > > WHERE Incident_ID = '$Incident_Number$' AND PassOffReason <> NULL > > > > Session Tracking gets incident info pushed to it every time a ticket > is modified. If a passoff occurs, the user is forced to select a > reason. So I figured, if I count all the tickets where the ID matches > the current ticket, and there is a value in that field, then I can set > that field to SQL result set $1$ and it should work. I made a test > ticket and created a couple sessions, 4 I think, and 2 of them have a > value in the PassOffReason field, but when the active link runs, it sets that field to 0. > > > > Any ideas? We're on 5.1.2. SQL 2K Win 2K3 > > > > Thanks, > > > > Michael A. McManus, SSgt, USAF > > Remedy Developer > > HQ 754 ELSG/DOMH > > DSN: 596-6478 / Comm: 334-416-6478 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.10/908 - Release Date: 7/19/2007 6:10 PM ________________________________________________________________________ _______ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are" _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are"