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:

E-Mailer (WebCatb15acgiMac) (1997) Webstar 1.3.1 PPC (1997) Hiding Brands (2004) PCS Customer submissions ? (1997) RE: Auto conversion of URLs? (1998) Extended [ConvertChars] (1997) Email Formatting and Encryption (1998) bug in [SendMail] (1997) plugin-acgi, different results (1997) Web Developer Product Awards (1997) WebSTAR/WebCat is serving .db files! (1999) [WebDNA] Crashing again (2008) WebCat2b12 - nesting [tags] (1997) FileMaker and WebCat (1999) searchable list archive (1997) Couple of questions (1999) URGENT: NO BUG, woFIELDdata & FIELDword=ww (2002) Making Thumbnail Graphics (1997) [OT] Live Chat with Video capability (2008) Auto Submit (2000)