You must write

Select max(po_number) + 1 FROM AST_PurchaseOrder

Then you can map 

PO Number = $1$ 

-----Ursprüngliche Nachricht-----
Von: Action Request System discussion list(ARSList) 
[mailto:arsl...@arslist.org] Im Auftrag von Muhlethaler, Laurie
Gesendet: Mittwoch, 17. Dezember 2008 20:29
An: arslist@ARSLIST.ORG
Betreff: 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 
<norm.kai...@eglin.af.mil> 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:arsl...@arslist.org] On Behalf Of Muhlethaler, Laurie
>Sent: Wednesday, December 17, 2008 1:11 PM
>To: arslist@ARSLIST.ORG
>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"

Reply via email to