Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Members: 514
Language: English
Group categories:
Computers > Software
More group info »
Recent pages and files
QUERY: Count of patients for an age range    

The following will give you a count of patients with activity in calendary year 2006 who were between 13 and 19 on the last day of 2006.

 

SELECT
COUNT(distinct a.ptnum) AS "numpts"
FROM
journal a
JOIN patients b on a.ptnum = b.ptnum
WHERE
trantype = 's'
AND amount > 0
AND trandate BETWEEN '2006-01-01' AND '2006-12-31'
AND AgeInYears(dob,'2006-12-31') BETWEEN 13 AND 19

Version: 
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google