kenneth2k1 Posted July 12, 2002 Posted July 12, 2002 Sup! I'm not the sharpest knife in the drawer, so I would appreciate a little help with this. I am working on a system that calculates how many days until a child's graduation. What I have done so far is make three fields: Birthdate (regular date field) Date_Graduation (Date( Month(Birthdate) , Day(Birthdate) , Year(Birthdate) + 18 ) Grad_Countdown (Date_Graduation - Status( CurrentDate) - result of calc is a number) Now I'm sure you have already figured out what is wrong with this and are saying, "but Ken, this only calculates how many days until they turn 18." Right. Since school years in my part of the woods end in the beginning of June (we'll say June 1st), I need to have the system calculate how many days from now until June 1st of the year they turn 18. Make sense? Thanks in advance for the help. I have never had a question that couldn't be answered here. Ken
danjacoby Posted July 12, 2002 Posted July 12, 2002 GradDate = DateToText("6/1/" & Year(Birthdate)+18 This returns a Date DaysTillGraduation = GradDate - Status(CurrentDate) This returns a number. Make sure not to store this calc. You can also set up fields for the month & day of graduation, then plus those numbers into GradDate. You can also set up a formula for whether you should add 17 or 18 to the birth year, depending on the actual birthday. I leave these last two exercises for the student.
kenneth2k1 Posted July 12, 2002 Author Posted July 12, 2002 Ah! Thanks so much for the help! I will contemplate how to set up the forumula you speak of... I think I might know how to set this up... Thanks again Ken
kenneth2k1 Posted July 15, 2002 Author Posted July 15, 2002 Dan, I input the calculations as you have shown, and now I have more questions. First, I am assuming that since GradDate has "DateToText" that it is going to be a text field w/ calcuation? If so, when I set up like this, it returns a date of 8/14/1676, regardless of the date entered in the birthdate field. If I set it as a calc field returning text, I get the same year, 1676. Returning a date, it gives me a question mark "?". Please enlighten on what I am doing wrong. Oh yeah. You can also set up a formula for whether you should add 17 or 18 to the birth year, depending on the actual birthday. I am guessing that I will set up an If statement that goes something like this: If [Month(birthdate) >= 6, date calc + 17, date calc + 18]. (Please, no help with this one, I want to try it myself once I get the first problem solved). Thanks again for your help Ken
keshalyi Posted July 15, 2002 Posted July 15, 2002 Well... not my solution, but it looks to me like that datetotext is supposed to be texttodate. You are building a string of the date, and you need to convert it into a valid date....
kenneth2k1 Posted July 15, 2002 Author Posted July 15, 2002 Ok, I tried this: GradDate= Date( 6, 1, Year(Birthdate) + 18) - Calculation field returning date. It seems to work. Is this ok? Here is the final calculation: If(Month(BirthdateChild) >= 6 ,Date( 6 , 1 , Year(BirthdateChild) + 17), Date( 6 , 1 , Year(BirthdateChild) + 18)) Ken
Recommended Posts
This topic is 8166 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