I am working on MSSQL 2005
I want in table TMPMATERIALORDERED field Quantity should be numeric and greater than 0, if not than the
STATUS should be set to FAILURE and REMARKS should be set to Quantity is not numeric or Quantity is less than 0
In table TMPMATERIALORDERED my filed Quantity is nvarchar(100)
My query gives error says
Msg 4145, Level 15, State 1, Line 3
An expression of non-boolean type specified in a context where a condition is expected, near 'Then'.
Please find my query below and help me in correcting it
Set STATUS = Case
When Not IsNumeric(Quantity) Then 'FAILURE'
When IsNumeric(Quantity) And Quantity <=0 Then 'FAILURE'
Set REMARKS = Case
When Not IsNumeric(Quantity) Then 'Quantity is not numeric'
When IsNumeric(Quantity) And Quantity <=0 Then 'Quantity is less than 0'
QUANTITY IS NULL
AND STATUS IS NULL