Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have this SQL case statement for summing up the values after converting as shown below;
CASE WHEN NCC.ncc_type='-' THEN
SUM
(
CASE WHEN NCC.[NCC_ve_NCC] IS NULL THEN ''
WHEN NCC.[NCC_ve_NCC] LIKE '%.''%' THEN CAST(REPLACE(LTRIM(RTRIM(NCC.[NCC_ve_NCC])),'.''','.') AS FLOAT)
ELSE CAST(REPLACE(REPLACE(LTRIM(RTRIM(NCC.[NCC_ve_NCC])),',',''),',','') AS FLOAT)
END
)
ELSE 0
END AS 'Overrun_Cost',
How can I include in my script? Any help is appreciated.
thanks
Bhavesh
Try this once:
=if(NCC.ncc_type = '-',
if(isnull( NCC.[NCC_ve_NCC]),'',
if(wildmatch(NCC.[NCC_ve_NCC],'%.''%'), num(replace(trim(NCC.[NCC_ve_NCC]),'.''','.')),
REPLACE(REPLACE(TRIM(NCC.[NCC_ve_NCC]),',',''),',','')
)),0)
as Overrun_Cost
resident <>;
Need to check the brackets.
Br,
KC
Try this once:
=if(NCC.ncc_type = '-',
if(isnull( NCC.[NCC_ve_NCC]),'',
if(wildmatch(NCC.[NCC_ve_NCC],'%.''%'), num(replace(trim(NCC.[NCC_ve_NCC]),'.''','.')),
REPLACE(REPLACE(TRIM(NCC.[NCC_ve_NCC]),',',''),',','')
)),0)
as Overrun_Cost
resident <>;
Need to check the brackets.
Br,
KC
thank you it worked