Currency and Date queries, need help!

V

Viv_500

How do you query using the year part of the short date forma
(00/00/00)? I need to select a balance in one table and subtract i
from a balance in another when the year part is the same as the curren
year. I need the query to look something like:

INSERT INTO Account(Balance)
SELECT Account_History.Balance
FROM Account, Account_History
WHERE Account.Payment_Date(Year) = (Current Year)

Can these queries be used in the control source as they don't seem t
show up in the expression builder?


I also need to have an expression/query that calculates when a perso
becomes 65 using their DOB (00/00/00). Has anyone had any succes
having 4 digits for the year as we have members that were born ver
early in the 20th century and this gives problems with querying.

If anyone can help I will be very grateful
 
A

Allen Browne

Simplest to code is to use the Year() function:
WHERE Year(Account.Payment_Date) = Year(Date())

It would be more efficient to use:
WHERE Account.Payment_Date Between
DateSerial(Year(Date()),1,1) And
DateSerial(Year(Date()),12,31)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top