Hi ,
The below query doesnot return proper results. If I take out the condition for the field BUG.BG_USER_06, I get proper results. Please help
SELECT BUG.BG_BUG_ID as 'DEFECT ID',BUG.BG_SUMMARY AS 'DESCRIPTION',BUG.BG_STATUS AS 'STATUS', BUG.BG_DETECTION_DATE /*Defect.Detected on Date*/ as 'Detected Date', BUG.BG_SEVERITY AS 'SEVERITY LEVEL', BUG.BG_USER_01 AS 'ASSIGNED TO', BUG.BG_RESPONSIBLE /*Defect.Last Assigned*/ as 'Last Assigned', BUG.BG_USER_11 /*Defect.System*/ as 'System' , BUG.BG_USER_08 /*Defect.Expected Fix Date*/ as 'Expected Fix Date' , BUG.BG_DETECTED_BY /*Defect.Detected By*/ as 'Detected By' , BUG.BG_USER_06 /*Defect.Estimated Completion Date*/ as 'Estimated Completion Date'
FROM BUG Where BUG.BG_USER_11 in ('Condition1','Condition2','Condition3','Condition4') and BUG.BG_STATUS IN('Open','New','ReOpen') and BUG.BG_SEVERITY /*Defect.Severity*/ in ('1-Critical','2-Urgent') and BUG.BG_USER_06 IN (select BUG.BG_USER_06 from BUG where BUG.BG_USER_06 is null or BUG.BG_USER_06 /*Defect.Expected Fix Date*/ <= CONVERT (date, SYSDATETIME()) )
Thanks,
Vikram