Hi all,
I appreciate your help.
I've got a DateRange Form built. It allows me to enter two date values and then retrieves all records on or between the defined dates. Now I'd like to accomplish a second task with this form...
In my table I have a date of birth column ("DOB"). When running the form for Date Range, I'd also like to take the DOB column and produce an Age in an "Age" column. However, I only want it to show me the Age value for the records that are being returned by the Date Range query. Ideally: Access would find the "xdate" (dates within datee range), look at the DOB, calculate the age, then spit that out in my results. I hope this makes sense. Example:
DATERANGEQUERY FORM
Start Date: 1/1
End Date: 1/3
Returns:
[DATE IS 1/1 TO 1/3] [CUSTOMER NAME] [AGE]
I've tried the following expression to make the Age column populate, but it blanks out my "xdate" column AND the "age" column. Basically, adding this expression breaks my query and my form -- no errors, just no results. Here's the code I'm trying for the Age:
Help!Code:DateDiff("yyyy",[DOB],Date())+Int(Format(Date(),"mmdd")<Format([DOB],"mmdd")