Hey guys,
I'd posted earlier about creating a database for a vaccination clinic is a slum. All the responses were really helpful (thank you!) but I'm encountering some further problems. In a table named "Table Children" I have a "Date of Birth field" and and an "Age at the time of first joining the program" right next to each other. General practice is to enter the date of the birth of the child but many people don't know their child's date of birth and give an age.
Basically, I want to calculate the age of the child when he first came to our clinic so I've created a query and I'm doing
Age: DateDiff("m",[Table Children]![Date of Birth],[Table Children]![Date of entry])
Date of entry is the date the child came for his first shot.
The problem is that in some cases I don't have a date of birth just the age the parent has given.
So I need a function or something that basically calculates age when a date of birth is given and when it isn't given copies age from the "Age at the time of first joining the program". In a different query or the same I'd also like to calculate date of birth where it isn't given.
I'm thinking I need to use the Nz or IIf function but I'm verrrrryyy new to access so have no idea how this is done.
Thanks for all the help guys!