P
pb
I'm using the following to find out who is expected to by recalled
(RECALLDUEDATE;shortdate format) by upcoming month. 2 Tables. PATIENTS &
SCHEDULED. PT_ID is unique and is the PK of PATIENTS Table.
The problem is if 2 patients have a RECALLDUEDATE of January 1st, 2006 and
January 10th, 2007, both of them are selected for this upcoming january. How
can i modify below to select only by upcoming month, without selecting all
the years?
SELECT PATIENTS.*, SCHEDULED.*
FROM PATIENTS, SCHEDULED
WHERE PATIENTS.PT_ID=SCHEDULED.PT_ID And SCHEDULED.RECALLDUEDATE>Now() And
MONTH(SCHEDULED.RECALLDUEDATE)=1
SELECT PATIENTS.*, SCHEDULED.*
FROM PATIENTS, SCHEDULED
WHERE PATIENTS.PT_ID=SCHEDULED.PT_ID And SCHEDULED.RECALLDUEDATE>Now() And
MONTH(SCHEDULED.RECALLDUEDATE)=2
..
..
..
..down to december...
..
..
SELECT PATIENTS.*, SCHEDULED.*
FROM PATIENTS, SCHEDULED
WHERE PATIENTS.PT_ID=SCHEDULED.PT_ID And SCHEDULED.RECALLDUEDATE>Now() And
MONTH(SCHEDULED.RECALLDUEDATE)=12
(RECALLDUEDATE;shortdate format) by upcoming month. 2 Tables. PATIENTS &
SCHEDULED. PT_ID is unique and is the PK of PATIENTS Table.
The problem is if 2 patients have a RECALLDUEDATE of January 1st, 2006 and
January 10th, 2007, both of them are selected for this upcoming january. How
can i modify below to select only by upcoming month, without selecting all
the years?
SELECT PATIENTS.*, SCHEDULED.*
FROM PATIENTS, SCHEDULED
WHERE PATIENTS.PT_ID=SCHEDULED.PT_ID And SCHEDULED.RECALLDUEDATE>Now() And
MONTH(SCHEDULED.RECALLDUEDATE)=1
SELECT PATIENTS.*, SCHEDULED.*
FROM PATIENTS, SCHEDULED
WHERE PATIENTS.PT_ID=SCHEDULED.PT_ID And SCHEDULED.RECALLDUEDATE>Now() And
MONTH(SCHEDULED.RECALLDUEDATE)=2
..
..
..
..down to december...
..
..
SELECT PATIENTS.*, SCHEDULED.*
FROM PATIENTS, SCHEDULED
WHERE PATIENTS.PT_ID=SCHEDULED.PT_ID And SCHEDULED.RECALLDUEDATE>Now() And
MONTH(SCHEDULED.RECALLDUEDATE)=12