Hi All,
Here I have written a query to find the total for 30Days for a perticular member after the discharge date.
These 30Days Amount will be populated into another table based on joins.
Now my question is i am trying to get the total for 60 Days , 90 Days and 180 Days.
I can write Different queries changing datediff to 60,90,180 but i want all those fields in single query .
please suggest how to write in single query....
Select Distinct ip.member
sum(isnull(NetAmt,0.00)) as 30DaysAmount
from claims c
join claimsDetail cd on c.claimsnbr=cd.claimsnbr
join inpatient ip on cd.membernbr=ip.membernbr
where c.formnbr='SNF'
and (datediff(day,cd.specificdateofservice ,dischargedate) between 0 and 30
group by ip.member
I really appreciate your help.
Thanks,
Kalyan.