That did it! Thank you very much Norm and Conny (actually Conny Martin clued me in first)! And thank you to everyone else who responded!
Laurie Muhlethaler Remedy Developer / Administrator On Wed, 17 Dec 2008 13:49:26 -0600, Kaiser, Norm E CIV USAF AFMC 96 CS/SCCE <[email protected]> wrote: >What I was trying to say in my original reply (and communicated poorly) >was that $PO Number$ tells Remedy to translate what's currently in the >PO Number field and poke it into the SQL statement. So if PO Number >currently contains the value "skizzle", you'll end up passing... > >max(skizzle) + 1 FROM AST_PurchaseOrder > >to the database! > >Which results in...error! > >So you need to supply the actual field name, as it's represented in the >database, which is probably PO_Number. > >So the SQL would be... > >max(PO_Number) + 1 FROM AST_PurchaseOrder > >And then just set PO Number in the SET FIELDS action to $1$. > >Norm > > > > >-----Original Message----- >From: Action Request System discussion list(ARSList) >[mailto:[email protected]] On Behalf Of Muhlethaler, Laurie >Sent: Wednesday, December 17, 2008 1:38 PM >To: [email protected] >Subject: Re: SQL statement error > >Yes - that's exactly what I'm doing. I am doing it via a Set Fields >action. I don't want to do this through a Direct SQL If Action, do I? > >Laurie Muhlethaler >Remedy Developer / Administrator > >On Wed, 17 Dec 2008 13:31:06 -0600, Opela, Gary L CTR USAF AFMC 72 >CS/SCBAH ><[email protected]> wrote: > >>Do a set fields from direct SQL. Have your sql query be: >> >>SELECT max($PO Number$) + 1 FROM AST_PurchaseOrder >> >> >>Map your PO Number field at the bottom to $1$ >> >>Is this what you are doing? >> >>Thanks, >> >>Gary Opela, Jr. >> >> >> >> >>-----Original Message----- >>From: Action Request System discussion list(ARSList) >>[mailto:[email protected]] On Behalf Of Muhlethaler, Laurie >>Sent: Wednesday, December 17, 2008 1:29 PM >>To: [email protected] >>Subject: Re: SQL statement error >> >>I'm not sure I understand. I want to auto-populate the PO Number field >>with the next available PO #. I would like to accomplish this through >>direct SQL rather than creating an additional field(s) and >workflow....? >> >>Laurie Muhlethaler >>Remedy Developer / Administrator >> >> >>On Wed, 17 Dec 2008 13:15:41 -0600, Kaiser, Norm E CIV USAF AFMC 96 >>CS/SCCE >><[email protected]> wrote: >> >>>Looks like $PO Number$ is a field reference and Remedy is passing the >>>contents of PO Number (not the field name) to SQL, which is likely >NULL >>>because the field is empty when you run this. >>> >>>-----Original Message----- >>>From: Action Request System discussion list(ARSList) >>>[mailto:[email protected]] On Behalf Of Muhlethaler, Laurie >>>Sent: Wednesday, December 17, 2008 1:11 PM >>>To: [email protected] >>>Subject: SQL statement error >>> >>>** >>> >>>Listers ~ I am getting the following error during a SQL set fields >>>action: >>> >>> >>> >>>ARERR [552] Failure during SQL operation to the database : The max >>>function requires 1 argument(s). (SQL Server 174) >>> >>> >>> >>>My SQL command is listed below and I can successfully run it from SQL >>>Server: >>> >>> >>> >>>SELECT max($PO Number$) + 1 FROM AST_PurchaseOrder >>> >>> >>> >>> >>> >>>What am I doing wrong here? Thank you in advance. >>> >>> >>> >>> >>> >>>Windows Server 2003 >>> >>>SQL Server 2005 >>> >>> >>> >>>7.1.00 Patch 002 >>> >>>AR Server >>> >>> >>> >>>7.0.03 Patch 006 >>> >>>Service Desk >>> >>>Asset Management >>> >>> >>> >>>CMDB - 2.1.00 Patch 002 >>> >>>DSL - 1.0.00 Patch 1516 >>> >>> >>> >>> >>> >>>Laurie Muhlethaler >>> >>>First Republic Bank >>> >>>Remedy Developer / Administrator >>> >>>415.364.4436 >>> >>> >>> >>> [First Republic Bank logo]<http://logos.firstrepublic.com/FRB.jpg> >>>________________________________ >>> >>>The information transmitted is intended only for the person or entity >>to >>>which it is addressed and may contain confidential and/or privileged >>>material. Any review, retransmission, dissemination or other use of, >or >>>taking of any action in reliance upon, this information by persons or >>>entities other than the intended recipient is prohibited. If you >>>received this in error, please contact the sender and delete the >>>material from any computer. This message cannot be guaranteed to be >>>secure or error-free. >>> >>>First Republic Bank and its related entities do not take >responsibility >>>for, or accept time-sensitive instructions sent by email including >>>orders, funds transfer instructions or stop payments on checks. All >>>instructions of this nature must be handled by direct communication, >>not >>>email. >>> >>>We reserve the right to monitor and review the content of all email >>>communications sent or received. Emails sent to or from this address >>may >>>be stored in accordance with regulatory requirements. >>> >>>First Republic Bank is a Division of Merrill Lynch Bank & Trust Co., >>FSB >>>__Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" >>>html___ >>> >>>_____________________________________________________________________ _ >_ >>____ >>____ >>>UNSUBSCRIBE or access ARSlist Archives at www.arslist.org >>>Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" >>>===================================================================== = >= >>= >> >>---------------------------------------------------------------------- - >- >>-- >>The information transmitted is intended only for the person or entity >to >>which it is addressed and may contain confidential and/or privileged >>material. Any review, retransmission, dissemination or other use of, or >>taking of any action in reliance upon, this information by persons or >>entities other than the intended recipient is prohibited. If you >>received this in error, please contact the sender and delete the >>material from any computer. This message cannot be guaranteed to be >>secure or error-free. >> >>First Republic Bank and its related entities do not take responsibility >>for, or accept time-sensitive instructions sent by email including >>orders, funds transfer instructions or stop payments on checks. All >>instructions of this nature must be handled by direct communication, >not >>email. >> >>We reserve the right to monitor and review the content of all email >>communications sent or received. Emails sent to or from this address >may >>be stored in accordance with regulatory requirements. >> >>First Republic Bank is a Division of Merrill Lynch Bank & Trust Co., >FSB >> >>______________________________________________________________________ _ >_ >>_______ >>UNSUBSCRIBE or access ARSlist Archives at www.arslist.org >>Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" >> >>______________________________________________________________________ _ >____ >____ >>UNSUBSCRIBE or access ARSlist Archives at www.arslist.org >>Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" >>====================================================================== = >= > >----------------------------------------------------------------------- - >-- >The information transmitted is intended only for the person or entity to >which it is addressed and may contain confidential and/or privileged >material. Any review, retransmission, dissemination or other use of, or >taking of any action in reliance upon, this information by persons or >entities other than the intended recipient is prohibited. If you >received this in error, please contact the sender and delete the >material from any computer. This message cannot be guaranteed to be >secure or error-free. > >First Republic Bank and its related entities do not take responsibility >for, or accept time-sensitive instructions sent by email including >orders, funds transfer instructions or stop payments on checks. All >instructions of this nature must be handled by direct communication, not >email. > >We reserve the right to monitor and review the content of all email >communications sent or received. Emails sent to or from this address may >be stored in accordance with regulatory requirements. > >First Republic Bank is a Division of Merrill Lynch Bank & Trust Co., FSB > >_______________________________________________________________________ _ >_______ >UNSUBSCRIBE or access ARSlist Archives at www.arslist.org >Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" > >_______________________________________________________________________ ____ ____ >UNSUBSCRIBE or access ARSlist Archives at www.arslist.org >Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" >======================================================================= = -------------------------------------------------------------------------- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. This message cannot be guaranteed to be secure or error-free. First Republic Bank and its related entities do not take responsibility for, or accept time-sensitive instructions sent by email including orders, funds transfer instructions or stop payments on checks. All instructions of this nature must be handled by direct communication, not email. We reserve the right to monitor and review the content of all email communications sent or received. Emails sent to or from this address may be stored in accordance with regulatory requirements. First Republic Bank is a Division of Merrill Lynch Bank & Trust Co., FSB _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

