Query to inform me of future appointments???

TYLER_DURDEN

Registered User.
Local time
Today, 00:18
Joined
Mar 20, 2003
Messages
22
What I need is to build a query, that when I open it shows me only the patients that will have an appointment 5 days from now. I already have a query built that when I put in the first appointment date it automatically sets up the dates for the next 8 appointments, but what I need is for it to show me only the appointments 5 days from the day I run the query. Hope this makes sense, please help!!!

TD
 
Here's your criteria.

DateAdd("d", 5, Date())
 
I copied and pasted it into my criteria, but i get nothing, what am I doing wrong. Did I need to make a different query from the one I already have???
 
Have you set up your table like this?

Appointment1, Appointment2, Appointment3,...Appointment8

If so, that's not the right way to go and you'll need to normalise your database.
 
Whoa Normalise??? Yes that is bascially how mine is setup. What actions must I take to Normalise it???

Thanks.
 
TYLER_DURDEN,

Can you post you db here? That would help us to see how you've set up your tables.
 
I tried to attach my database, but it said it was an invalid format. But here is a pic of the query.
 

Attachments

  • database.jpg
    database.jpg
    19.8 KB · Views: 128
Last edited:
Looking at the picture I can clearly see the problem.

Two options:

i) Normalise your database - this might mean going back to the start and designing it better. This is advantageous as it can prevent problems in the future and is advised.

ii) Don't normalise your database - this way you can do what you want but has the disadvantage that the data is stored messily, harder to calculate upon, and can waste space if some fields remain without data.

You may, however, not have time to perform the former option.

On your query, you have put the formula I initially suggested on the same row for each appointment which is saying:

Show me all appointments where App1 is equal to five days from now AND App2 is equal to five days from now AND App3 is equal to five days from now, etc

when what you want to use is the OR argument.

Show me all appointments where App1 is equal to five days from now OR App2 is equal to five days from now OR App3 is equal to five days from now, etc.

In your query builder grid there are numerouse rows for putting criteria - drop the criteria along your appointments so that it is stepped.


Appointment1 Appointment2 Appointment3
DateAdd(etc)..................................................
........................DateAdd(etc).......................
...............................................DateAdd(etc)
 
Woo Hoo!!! I think I got it!!! THanks alot!!!

Now I need to figure out how to get the database to automatically send me an email when ever one of these patients hits my query for an appointment in 5 days. Any help? I know I posted this question earlier, but I found the answer confusing.

TD
 

Users who are viewing this thread

Back
Top Bottom