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: [email protected]
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
 __20060125_______________________This posting was
submitted with HTML in it___

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

Reply via email to