Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with converting DECODE Function in sql statment into formula fiel

Status
Not open for further replies.

vancoug

MIS
Aug 11, 2008
12
US
I know this will sound stupid, especially here, but I am having trouble with this. I know decode is like a if-then-else statement, but I am having difficulty converting this into a IF-THEN_ELSE statement to be used in a formula field in Crystal Reports. I am a new-B and any help would be appreciated.

nvl(decode(pu.business_partner_id, NULL, NULL, decode(substr(pu.business_partner_id,1,1), NULL, NULL,'-', po.channel_partner_id||pu.business_partner_id, null)), po.business_partner_id) user_partner_id,

 
@user_partner_id

If isnull(pu.business_partner_id) then po.business_partner_id
else
if left(pu.business_partner_id, 1) = '-' then po.channel_partner_id&pu.business_partner_id
else po.business_partner_id

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top