Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Please could someone help me amend this code?
So that it is NOT restricted to Cell - i.e 1200 Relay
and NOT restricted to 'Broken damaged parts'
But KEEPS the code that deals with the NULLs
Apologies but new to qlikview and SQL.
Thank you
SELECT *
FROM UPDC_MDIData
WHERE UPDC_MDIData.Cell = '1200 Relay'
AND CHARINDEX('Broken/damaged part', ISNULL(UPDC_MDIData.TimeOverCode, '')) > 0
AND UPDC_MDIData.TaskEnded BETWEEN '2016-08-01' AND '2016-09-01'
This query give correct out put to you on the SQL did you check.
You can try this
SELECT *
FROM UPDC_MDIData
WHERE UPDC_MDIData.Cell = '1200 Relay'
AND CHARINDEX('Broken/damaged part', ISNULL(UPDC_MDIData.TimeOverCode, '')) >= -1
AND UPDC_MDIData.TaskEnded BETWEEN '2016-08-01' AND '2016-09-01'
only change is in place of ( >0 ) you have to use ( >= -1 )
Regards
Anand
Hi, Emma.
You can try to replace first condition in WHERE expression with following:
WHERE UPDC_MDIData.Cell like N'%1200 Relay%'
second condition with
UPDC_MDIData.TimeOverCode like N'%Broken/damaged part%'
and the last one with this(if UPDC_MDIData.TaskEnded has type of Date)
UPDC_MDIData.TaskEnded > convert(date, '2016-08-01' , 126) and UPDC_MDIData.TaskEnded > convert(date, '2016-09-01' , 126)