rupes_mahal
Registered User.
- Local time
- Today, 14:45
- Joined
- Aug 12, 2001
- Messages
- 60
Hi...
I have a table which consists of patients details. Each record has a date field which is recorded when a patient is ill.
What I need to do is to write a query which returns records which are 3 years old from the present date. When I click on a command button....I want all the 3 year old records to appear in datasheet view. Also when clicked on another button...the records should appear in form view.
Another condition in the query is to return records which have Part Number as II.
I have build a query, but it does not return any records:
SELECT PremFormRegisterTBL.ReferenceNo, PremFormRegisterTBL.PremiseCode, PremFormRegisterTBL.ReasonforReview, PremFormRegisterTBL.PartNumber, PremFormRegisterTBL.Supercedes, PremFormRegisterTBL.[Prem1(WEFdate)], PremFormRegisterTBL.InvoiceDate, PremFormRegisterTBL.InvoiceNo,
FROM DoctorsDetailsTBL INNER JOIN PremFormRegisterTBL ON DoctorsDetailsTBL.PremiseCode = PremFormRegisterTBL.PremiseCode
WHERE (((PremFormRegisterTBL.[Prem1(WEFdate)])=DateDiff("yyyy",Now(),Now()-3)) AND (((PremFormRegisterTBL.[PartNumber])="II")));
Please help....as I am desparate and can not work any further until I fix this problem...
THANKYOU IN advance..
Ruby
I have a table which consists of patients details. Each record has a date field which is recorded when a patient is ill.
What I need to do is to write a query which returns records which are 3 years old from the present date. When I click on a command button....I want all the 3 year old records to appear in datasheet view. Also when clicked on another button...the records should appear in form view.
Another condition in the query is to return records which have Part Number as II.
I have build a query, but it does not return any records:
SELECT PremFormRegisterTBL.ReferenceNo, PremFormRegisterTBL.PremiseCode, PremFormRegisterTBL.ReasonforReview, PremFormRegisterTBL.PartNumber, PremFormRegisterTBL.Supercedes, PremFormRegisterTBL.[Prem1(WEFdate)], PremFormRegisterTBL.InvoiceDate, PremFormRegisterTBL.InvoiceNo,
FROM DoctorsDetailsTBL INNER JOIN PremFormRegisterTBL ON DoctorsDetailsTBL.PremiseCode = PremFormRegisterTBL.PremiseCode
WHERE (((PremFormRegisterTBL.[Prem1(WEFdate)])=DateDiff("yyyy",Now(),Now()-3)) AND (((PremFormRegisterTBL.[PartNumber])="II")));
Please help....as I am desparate and can not work any further until I fix this problem...
THANKYOU IN advance..
Ruby