$LASTCOUNT$ won't work on SQL statement, you either need to
1. use Select count(*) from tablename where <qual>, and use $1$ returned 2. perform a set field function to return a value from a qualified search, then use LASTCOUNT from that. 3. Refresh a table field and use column count From: Action Request System discussion list(ARSList) [mailto:[email protected]] On Behalf Of Andrew Fremont Sent: 18 March 2010 8:52 PM To: [email protected] Subject: Re: Return SQL Count to Remedy ** Thank LJ, Partgeter, The set field using $LASTCOUNT$ right-after direct SQL set field does not return the correct count. It seems Remedy does not populate this keyword from the direct SQL. Changing to SELECT COUNT(*) as CNT still no luck... Still exploring other options... if not, we may need to do a set field action in Remedy with the "Set Field If" part equivalent to the "WHERE" clause in the SQL statement to get the $LASTCOUNT$ On Thu, Mar 18, 2010 at 1:14 PM, Pargeter, Christie :CO IS <[email protected]> wrote: ** Also try not using the word Count in your AS section. Sometimes DBs don't like you using their reserved words here. What happens if you just do SELECT COUNT(*) from ... then try SELECT COUNT(*) as CNT from ... _____ From: Action Request System discussion list(ARSList) [mailto:[email protected]] On Behalf Of LJ Longwing Sent: Thursday, March 18, 2010 12:48 PM To: [email protected] Subject: Re: Return SQL Count to Remedy ** When you do your 'select request_id...' query, create another setfield after that one and set the field you want with $LASTCOUNT$....that's the count of the last search performed...in this case your direct sql select statement. _____ From: Action Request System discussion list(ARSList) [mailto:[email protected]] On Behalf Of Andrew Fremont Sent: Thursday, March 18, 2010 1:43 PM To: [email protected] Subject: Return SQL Count to Remedy ** Hi, We have some direct SQL in filter action to write data to file on server, and we also want to get a number of rows from direct SQL. Is it possible to return the count from the SQL to remedy? We're able to get the column values from the "SQL Result Column" 1 - 10, but could find the way to get the count. "SELECT Request_Id ..." returns expected values in "SQL Result Column" 1 - 10 "SELECT COUNT(*) as Count ..." returns NULL for all columns ARS 7.0.1 P005 MS SQL 2005 Win Server 2003 MT- 7.1 P006 Microsoft IIS ServletExec/5.0p06 Andrew. Thanks _Platinum Sponsor: [email protected] ARSlist: "Where the Answers Are"_ _Platinum Sponsor: [email protected] ARSlist: "Where the Answers Are"_ _Platinum Sponsor: [email protected] ARSlist: "Where the Answers Are"_ _Platinum Sponsor: [email protected] ARSlist: "Where the Answers Are"_ _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"

