• Pass-Through Query in Access

    Author
    Topic
    #495412

    I have an expression written in Access
    Mid([CBP], (InStr(5,[CBP],”~”)+1), (IIf((InStr((InStr(5,[CBP],”~”)+1),[CBP],”~”)-(InStr(5,[CBP],”~”)+1))>0,(InStr((InStr(5,[CBP],”~”)+1),[CBP],”~”)-(InStr(5,[CBP],”~”)+1)),0)))

    What I need to do is translate this into SQL so I can use it in a pass-through query connecting to an Oracle database.

    I have the syntax down for everything except the “IIF”. Is there an equivalent function in SQL that can be used to complete this expression?

    Thanks for any help.

    Viewing 0 reply threads
    Author
    Replies
    • #1458345

      Richard,

      While editing the query just switch to SQL view to see how to code it. HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1458369

        I continued to play with it and was able to get this code to work.

        (CASE WHEN ((InStr(CBP,’~’,2,2))-(InStr(CBP,’~’,2)))>0
        THEN SUBSTR(CBP, (InStr(CBP, ‘~’, 2))+1, ( (InStr(CBP, ‘~’, 2, 2)) – (InStr(CBP, ‘~’, 2))-1 ) )
        ELSE NULL
        END )

    Viewing 0 reply threads
    Reply To: Pass-Through Query in Access

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: