krempch Posted February 19, 2009 Posted February 19, 2009 How do I compute a child's age in months? I have two DATE fields to compute the age from, child_dob and school_date both are 4-digit dates. I am not sure if I should use a Calculation field or scripting logic. Thanks in advance for advice.
comment Posted February 19, 2009 Posted February 19, 2009 Try: 12 * ( Year ( EndDate ) - Year ( StartDate ) ) + Month ( EndDate ) - Month ( StartDate ) - ( Day ( EndDate ) < Day ( StartDate ) ) This assumes that a person becomes a month older on the same day-in-month as his birthday or when the month ends - whichever happens first. Alternatively, you could just do a rough estimate based on the length of average month: Div ( EndDate - StartDate ; 30.436875 )
krempch Posted February 19, 2009 Author Posted February 19, 2009 Hi Comment ... I gave the second suggestion a try and it's perfect. The first suggestion simplifies what I've been seeing from other sources - it will be a good exercise for me to learn syntax. As always, THANK YOU! :laugh2:
Recommended Posts
This topic is 5816 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now