Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Halt calculation after a certain Date

Status
Not open for further replies.

JMM

Technical User
Feb 17, 2000
37
NZ
I have one field, &quot;DateStartedSchool&quot;. I have an unbound control, &quot;TimeatSchool&quot; linked to a function that calculates the time a child has been at school in years and months. This part works fine BUT I can't figure out how to stop the calculation after the child has been at school for more than 13 years.<br><br>Variations on DateStartedSchool - Now() &gt; 13 etc don't seem to work.<br><br>Thanks VM
 
<b>IIf(Date()-[DateStartedSchool]&gt;13, 13, Date()-[DateStartedSchool])</b><br><br>this would return a value of &quot;13&quot; for anything greater than 13 years, and would return the number value for anything else.<br>One mistake was putting the [DateStartedSchool] first, this would return a negative value since it would actually be the lesser value.<br>And Date() usually works better than Now() since Now() includes hours, minutes, and seconds. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top