Skip to Content
author's profile photo Former Member
Former Member

Formatted Search

Hi,

I have the below formatted search, which works, to get a gl account from a service call linked to a sales order via a UDF (U_CallID).

select case when ISNULL($[RDR1.BASEENTRY],0) > 0

THEN $[$38.159]

when isnull($[ORDR.U_CalliD],'') = '' then $[$38.159.0]

else

(SELECT U_FormatCode

FROM OSCL (nolock)

WHERE (OSCL.callID = $[ORDR.U_CalliD]))

end as GLAcct

I now need to modify this to only apply the last else statement for when OSCL.CallType in (10,13,15) or OSCL.Customer = 'IDept01'

If the OSCL.Calltype <> 10, 13 ,15 then = $[$38.159.0] needs to apply.

Your assistance will be much appreciated.

Jacques

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2011 at 03:24 PM

    Hi Jacques,

    I am not quite sure what is your exact request. Check this first:

    select case when ISNULL($[RDR1.BASEENTRY],0) > 0
     
    THEN $[$38.159.0]
     
    when isnull($[ORDR.U_CalliD],'') = '' then $[$38.159.0] 
    else 
    (SELECT  T0.U_FormatCode
    FROM     OSCL T0 (nolock) 
    WHERE    T0.callID = $[ORDR.U_CalliD] AND (T0.CallType in (10,13,15) OR T0.Customer = 'IDept01'))
     
    end as GLAcct 

    Thanks,

    Gordon

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.