-
Jason Musgrove
AskWoody PlusNovember 10, 2012 at 4:37 pm in reply to: Calculate an age, adding # of months if child is not yet 1 year old #1356300so, you are only interested in “whole” months, then? The Datediff function simply subtracts the month numbers and returns the result, adding 12 for each additional year. If you want to round down to whole months (i.e. 364 days old = 11 months), then you are going to have to adjust the results to compensate for the difference in days and subtract one month. Try this
AGE: iif(datediff(“d”,[DOB],now())<365,datediff("m",[DOB],now()) – iif(datepart("d",now())-datepart("d",[DOB])<0,1,0) & " Months",datediff("YYYY",[DOB],now()))
notice that I trigger the "months" result based on 365 days old rather than "1 year", since datediff will return "1" year for the entire birth month. If the day of the month is greater than the day of the dob, I subtract 1 month to remove the incomplete month from the result. This sounds to me like what you are after.
-
Jason Musgrove
AskWoody PlusIs there a reason that you need two tables? If every tblDone record should correspond to a tblToBeDone record, it would make more sense to have these in the same table. This would prevent problems with miskeying the unique ID field, prevent duplicates, and make your queries easier in the long run by avoiding an extra join.
-
Jason Musgrove
AskWoody PlusNovember 9, 2012 at 10:46 am in reply to: Calculate an age, adding # of months if child is not yet 1 year old #1355930The datediff paramaters are in a different order than the datedif example from excel. Try this:
AGE: iif(datediff(“YYYY”,[DOB],now())=0,datediff(“m”,[DOB],now()) & ” Months”,datediff(“YYYY”,[DOB],now()))
-
Jason Musgrove
AskWoody PlusDefinately a Data problem. There are two primary problems that you need to address. First, your “Unique IDs” aren’t unique. There are duplicates in both tables. This will throw off your totals since each record in tblDone can “match” multiple records in tblToBeDone. Run a “Find Duplicates” query on each table to identify and fix these. Next, there are numerous records in tblDone that don’t have a corresponding record in tblToBeDone. Therefore your total records in the tblDone table is more than the total records in the tblToBeDone table with a corresponding tblDone record.
You can run a few of queries to see what I mean.
First, join all records from tblDone to the corresponding records in tblToBeDone. You should get 1269 matches (this includes dupes).
Next, change the join to show all records from tblDone and only the records from tblToBeDone that match. Filter for NULL [ID]s on the tblToBeDone side to display tblDone records with no corresponding tblToBeDone record. There are 916 tblDone records with no corresponding “to be done”, which is why you have more “undone” records than you expect.
Finally, change the join to show all records from tblToBeDone and only the tblDone records that match. Filter for NULL [ID]s on the tblDone side to display tblToBeDone records with no corresponding tblDone record. This is the total number of records which are not “done”. I get 1185 records that are not “Done”.
Hope this helps.
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
KB5058379 / KB 5061768 Failures
by
crown
6 hours, 53 minutes ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
9 hours, 32 minutes ago -
At last – installation of 24H2
by
Botswana12
10 hours, 16 minutes ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
6 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
22 hours, 28 minutes ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
15 hours, 48 minutes ago -
Limited account permission error related to Windows Update
by
gtd12345
1 day, 11 hours ago -
Another test post
by
gtd12345
1 day, 12 hours ago -
Connect to someone else computer
by
wadeer
1 day, 6 hours ago -
Limit on User names?
by
CWBillow
1 day, 9 hours ago -
Choose the right apps for traveling
by
Peter Deegan
23 hours, 28 minutes ago -
BitLocker rears its head
by
Susan Bradley
7 hours, 29 minutes ago -
Who are you? (2025 edition)
by
Will Fastie
6 hours, 26 minutes ago -
AskWoody at the computer museum, round two
by
Will Fastie
1 day, 1 hour ago -
A smarter, simpler Firefox address bar
by
Alex5723
1 day, 22 hours ago -
Woody
by
Scott
2 days, 7 hours ago -
24H2 has suppressed my favoured spider
by
Davidhs
7 hours, 6 minutes ago -
GeForce RTX 5060 in certain motherboards could experience blank screens
by
Alex5723
2 days, 21 hours ago -
MS Office 365 Home on MAC
by
MickIver
2 days, 15 hours ago -
Google’s Veo3 video generator. Before you ask: yes, everything is AI here
by
Alex5723
3 days, 12 hours ago -
Flash Drive Eject Error for Still In Use
by
J9438
6 hours, 50 minutes ago -
Windows 11 Insider Preview build 27863 released to Canary
by
joep517
4 days, 6 hours ago -
Windows 11 Insider Preview build 26120.4161 (24H2) released to BETA
by
joep517
4 days, 6 hours ago -
AI model turns to blackmail when engineers try to take it offline
by
Cybertooth
3 days, 10 hours ago -
Migrate off MS365 to Apple Products
by
dmt_3904
3 days, 11 hours ago -
Login screen icon
by
CWBillow
3 days, 1 hour ago -
AI coming to everything
by
Susan Bradley
16 hours, 18 minutes ago -
Mozilla : Pocket shuts down July 8, 2025, Fakespot shuts down on July 1, 2025
by
Alex5723
4 days, 22 hours ago -
No Screen TurnOff???
by
CWBillow
4 days, 22 hours ago -
Identify a dynamic range to then be used in another formula
by
BigDaddy07
3 hours, 13 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.