Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
What I'm trying to do is:
If the 3 first character of H_SUPPLIERID1 = ‘FOU’ then H_SUPPLIERID1 else H_SUPPLIERID1 without the 3 first character
Ex : If ‘FOU_105758’ then ‘FOU_105758’
If ‘55_FOU_105758’ then ‘FOU_105758’
my code:
SQL SELECT
(H_CODE_SOCIETE) + '_' + (H_SUPPLIERID1) as CSUSUPID,
(H_CODE_SOCIETE) + '_' + (H_CODE_SECTEUR) as IDCAPLAN,
case when index(mid([H_SUPPLIERID1],3,1) '_')=0 then [H_SUPPLIERID1] else mid([H_SUPPLIERID1], 3) end as [SupplierId]
FROM SHARE.dbo.IDX;
The error message says there maybe a "with" or parenthesis missing with the index function.
I'd be greaful for any help.
Many thanks,
Florian
Try like
Load
If(Left(H_SUPPLIERID1,3) = 'FOU', H_SUPPLIERID1, Mid(H_SUPPLIERID1,4)) AS H_SUPPLIERID1,
...
;
SQL Select * from [Table name];
Try like
Load
If(Left(H_SUPPLIERID1,3) = 'FOU', H_SUPPLIERID1, Mid(H_SUPPLIERID1,4)) AS H_SUPPLIERID1,
...
;
SQL Select * from [Table name];