Calculated field error

OK, I keep getting a syntax error and need someone to point out what I am missing…

Thanks in advance.

Brad

See where it says Case DaysLate remove the DaysLate after the word Case

Thanks!! I figured it was something simple.

Sometimes we all need a second eye :slight_smile: I also tend to indent mine for easier reading

CASE
	WHEN TotalTagsOpen = 0 THEN ''
	WHEN (CCHdr.CycleStatus <> 0 AND CCHdr.CycleStatus <> 7) AND TotalTagsOpen <> TotalTagsReturned THEN 'Unreturned'
	WHEN (CCHdr.CycleStatus <> 0 AND CCHdr.CycleStatus <> 7) AND TotalTagsOpen = TotalTagsReturned THEN 'Returned'
	ELSE ''
END


CASE WHEN CCTag.FrozenQOH <> 0 THEN
	 ((CCTag.CountedQty - TotalFrozenQOH) / IIF(CCTag.FrozenQOH <> 0, ABS(CCTag.FrozenQOH), 1)) * 100
	ELSE 0
END

Also sometimes I create a few additional Calculated Fields then I can re-use them in several fields like in your case you could make a field called ReqDueDateDiff and do the entire datediff in there and then check the ReqDueDateDiff field in your CASE - but thats if you plan to create a few more calculated fields that may require checking the difference.

1 Like