Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two distinct criteria for 1 Report/Graph 2

Status
Not open for further replies.

evalesthy

Programmer
Oct 27, 2000
513
US
User wants a report showing patients who are Frequent Fallers for each month.

However, they define this as any person who falls 2 times in any week or 3 times in any month. (If someone satisfied both criteria they would only be counted once).

Questions: Weeks (Sunday - Saturday or Monday - Sunday) don't line up exactly with Calendar month. How do you work with that?

Overall, what is the simplest way to get to the end results?
Query for the first criteria, then for the second and write results for each to a table? Some other way?

 
Perhaps an Union query ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

I'd use boolean logic.

Within a month,

if [Sum of Falls]>2 then TRUE

or

if [Days Between Falls]<7 then TRUE (I'm just not sure how I'd do this one in a query)


Skip,

[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue]
 
Thanks PHV & SkipVought. I am currently experimenting with PHV's approach. I have created columns in my queries using Year, and Month functions to assign falls to Year/Month. Then in the other query to get down to week level I added a Datepart("ww", EDate) to gets falls down to a particular week. Then, by grouping and using a criteria of Falls > 2 (or 3) I can see who is a Frequent Faller. I now think PHV's Union Query will get me where I want to be. I'll finish up tomorrow and post back with how I make out. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top