Here is what I am trying to do:
SELECT iif(d.ItemType = 'INVOICE', 0, iif(d.ItemType = 'PACKING', 0, 1)) AS MissingDocuments FROM dbo.DocumentDetails AS D
Unfortunately realized this is not compatible with MSSQL2008. So tried writing an IF ELSE
but that also is not working.
SELECT IF d.ItemType = 'INVOICE'
0
ELSE
BEGIN
d.ItemType = 'PACKING'
0
ELSE
1
END AS MissingDocuments
FROM dbo.DocumentDetails AS D
can you please tell me what am I doing wrong here ?