Problem with Ages

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 41062
interpreted = N
texte = I'm using this code snippet to calculate ages of people in a db dynamically.[Format 10.0d][math](({[DATE %m/%d/%Y]}-{[DOB]})/365)[/math][/format]Someone pointed out this morning that a few ages are calculating wrong. At first, I thought it was rounding up so, I checked the archives and found this code:[math]floor(({[date]}-{[DOB]})/365)[/math]I put this in the template and got the same result and now I'm really perplexed. It did the math and showed the person's already 37 when the DOB is not until July 1. The DOB record is 7/01/65 (without the quotes).Can anyone explain this to me (or show me what's wrong with the code)? _______________________________________________________________________ Steve Dannaway | Director of Information Technology & General Counsel JM Associates | The Worldwide Leader in Outdoor Television _______________________________________________________________________------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Problem with Ages (Grant Hulbert 2002)
  2. Problem with Ages (Steve Dannaway 2002)
I'm using this code snippet to calculate ages of people in a db dynamically.[Format 10.0d][math](({[DATE %m/%d/%Y]}-{[DOB]})/365)[/math][/format]Someone pointed out this morning that a few ages are calculating wrong. At first, I thought it was rounding up so, I checked the archives and found this code:[math]floor(({[date]}-{[DOB]})/365)[/math]I put this in the template and got the same result and now I'm really perplexed. It did the math and showed the person's already 37 when the DOB is not until July 1. The DOB record is 7/01/65 (without the quotes).Can anyone explain this to me (or show me what's wrong with the code)? _______________________________________________________________________ Steve Dannaway | Director of Information Technology & General Counsel JM Associates | The Worldwide Leader in Outdoor Television _______________________________________________________________________------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Steve Dannaway

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

international time (1997) Item options w/ price adjustment (1997) Snake Bites (1997) Dreamweaver Extensions (2001) Dreamweaver (2002) quantity minimum problem (1997) FlushDatabase Suggestion (1998) Emailer Set Up (1997) E-mail formating question (1999) The USArea® Network web site ... (1997) WC 2.0 frames feature (1997) Fed Ex Interaction (2003) Re[3]: 2nd WebCatalog2 Feature Request (1996) normal users.db calls ... (1998) Multiple catalog databases and showcart (1997) WebCatalog for Postcards ? (1997) Databases inside [SHOWIF] (1998) OS X and Emailer (2002) Web*SSL and WebCatalog (1997) RE: shrink-wrapped version out yet? (1997)