Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Patients deactivated in the past 12 months
- SELECT
- p.LName,
- p.FName,
- sl.`LogDateTime`,
- sl.`LogText`,
- sl.`CompName`
- FROM securitylog sl
- INNER JOIN patient p ON sl.PatNum = p.PatNum
- WHERE
- sl.LogText LIKE "Patient status changed from 'Patient' to%"
- AND DATE(sl.LogDateTime) >= CURDATE() - INTERVAL 12 MONTH -- Limit results to previous 12 months
- ORDER BY
- LogDateTime DESC
- ;
Advertisement
Add Comment
Please, Sign In to add comment