SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Help with SSRS
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 10/04/2012 :  00:40:11  Show Profile  Reply with Quote
quote:
Originally posted by anishap

I'm not sure how to set the rules.

Here is the scenario, If an employee is due for TB or TBSS or CXRAY then it's non-compliant other wise compliant.

If FLDPHYSICAL = '110' OR
FLDPHYSICAL = 'TBSS' OR
FLDPHYSICAL = '109' AND
FLDDATEDUE IS NULL
THEN Compliant ELSE
Non_Compliant

Any thoughts on fixing this? Sorry to bother you again.


so what if you've multiple records with either of above values and also others values within group you consider. you would consider it as complaint or non-complaint?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

anishap
Yak Posting Veteran

61 Posts

Posted - 10/04/2012 :  14:55:18  Show Profile  Reply with Quote
I modified the query and it seems to be working now.

Thanks visakh for all your help.
*****************************

LEFT OUTER JOIN REQEXAM PPDx
ON PPDx.FLDEMPLOYEE = E.FLDREC_NUM
AND PPDx.FLDPHYSICAL = '110'
AND PPDx.FLDDATEDUE <= @end_date

LEFT OUTER JOIN REQEXAM TBSSx
ON TBSSx.FLDEMPLOYEE = E.FLDREC_NUM
AND TBSSx.FLDPHYSICAL = 'TBSS'
AND TBSSx.FLDDATEDUE <= @end_date

LEFT OUTER JOIN REQEXAM CDUEx
ON CDUEx.FLDEMPLOYEE = E.FLDREC_NUM
AND CDUEx.FLDPHYSICAL = '109'
AND CDUEx.FLDDATEDUE <= @end_date

Tb_Compliant = CASE WHEN PPDx.FLDDATEDUE IS NULL AND TBSSx.FLDDATEDUE IS NULL
AND CDUEx.FLDDATEDUE IS NULL
THEN 'YES'
ELSE 'NO'
END
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000