struggling with how to do this in the select statement: if Ledger.curr="CAN and ledger.bookper< val(LBookfrom), Ledger.osloss * , else if Ledger.curr="CAN and ledger.bookper >=val(LBookfrom), Ledger.osloss * nCurr , else Ledger.osloss as osloss
am I close ?
IIF((Ledger.curr)="CAN" AND ledger.bookper< Val((LBookfrom),Ledger.osloss * nChgVal, IIF((Ledger.curr)="CAN" AND ledger.bookper>= Val((LBookfrom),Ledger.osloss * Val(nCurr),Ledger.osloss) as OSLOSS
Exactly where you are trying to do this? At query level or expression? Anyway, to do this in query, try this:
case Ledger.curr when 'CAN' then case when ledger.bookper < Val(LBookfrom) then Ledger.osloss * nChgVal else Ledger.osloss * nCurr end else Ledger.osloss end as osloss
Exactly where you are trying to do this? At query level or expression? Anyway, to do this in query, try this:
case Ledger.curr when 'CAN' then case when ledger.bookper < Val(LBookfrom) then Ledger.osloss * nChgVal else Ledger.osloss * nCurr end else Ledger.osloss end as osloss