Re: Calculating Age from DB fields

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 54761
interpreted = N
texte = Problems with the correct age was solved by the "floor" math-syntax Thanks to all for the assistance. Palle On 8/12-2003, at 14.32, Dan Strong wrote: > Though if [AgeinYears] < 1, then it will of course, return 0. Is that > what you want? > -Dan > > On Sun, 07 Dec 2003 19:22:43 -0800 > "Dan Strong" wrote: >> ...or you could consolidate your code: >> AgeInYears=[Math]floor([AgeInDays]/365.25)[/Math] >> >> -Dan >> >> >> On Sun, 07 Dec 2003 14:26:32 -0800 >> "Dan Strong" wrote: >>> This is off the cuff and specific only to the method of rounding >>> something down in WebDNA... I haven't been following this thread... >>> hopefully this helps, if not, simply ignore :) >>> >>> [math]floor([AgeInYears])[/math] >>> >>> -Dan >>> >>> >>> >>> On Sun, 7 Dec 2003 22:01:18 +0100 >>> Palle Bo Nielsen wrote: >>>> The code you wrote workes just fine, but I need to round the result >>>> down. >>>> >>>> AgeInYears should be rounded down, and you can not do that with the >>>> format tag or can you. Not according to the docs. >>>> >>>> Any help in rounding down? >>>> >>>> Palle >>>> >>>> >>>> On 6/12-2003, at 16.36, Glenn Busbin wrote: >>>> >>>>>> Hi all, >>>>>> >>>>>> Some how my heads isn't working today, so I hope someone will be >>>>>> helpful... >>>>>> >>>>>> I have a profile database with a lot of personal profile info >>>>>> including these three fields >>>>>> >>>>>> db_date (01...31) >>>>>> db_month (01...12) >>>>>> db_year (1900...2010) >>>>>> >>>>>> I want to calculate the actual date based on todays date. >>>>>> >>>>> >>>>> You mean you want to calc the *age*, right? >>>>> >>>>> Use days to date. >>>>> >>>>> AgeInDays=[Math]([Math]{[Date]}[/Math])-([Math]{[db_month]/ >>>>> [db_date]/ [db_year]}[/Math])[/Math] >>>>> >>>>> AgeInYears=[Math]AgeInDays/365.25[/Math] >>>>> >>>>> ------------------------------------------------------------- >>>>> 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://webdna.smithmicro.com/ >>>>> >>>>> >>>> >>>> -- >>>> Venlig hilsen >>>> Palle B. Nielsen (PowerPalle) >>>> http://www.macnyt.dk/ >>>> >>>> >>>> >>>> ------------------------------------------------------------- >>>> 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://webdna.smithmicro.com/ >>> >>> ------------------------------------------------------------ >>> http://www.StrongGraphicDesign.com >>> http://www.SearchBoise.com >>> (208) 319-0137 | Toll-free p/f 877-561-1656 >>> ------------------------------------------------------------ >>> >>> ------------------------------------------------------------- >>> 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://webdna.smithmicro.com/ >> >> ------------------------------------------------------------ >> http://www.StrongGraphicDesign.com >> http://www.SearchBoise.com >> (208) 319-0137 | Toll-free p/f 877-561-1656 >> ------------------------------------------------------------ >> >> ------------------------------------------------------------- >> 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://webdna.smithmicro.com/ > > ------------------------------------------------------------ > http://www.StrongGraphicDesign.com > http://www.SearchBoise.com > (208) 319-0137 | Toll-free p/f 877-561-1656 > ------------------------------------------------------------ > > ------------------------------------------------------------- > 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://webdna.smithmicro.com/ > > -- Venlig hilsen Palle B. Nielsen (PowerPalle) http://www.macnyt.dk/ ------------------------------------------------------------- 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://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Calculating Age from DB fields ( Palle Bo Nielsen 2003)
  2. Re: Calculating Age from DB fields ( Palle Bo Nielsen 2003)
  3. Re: Calculating Age from DB fields ( "Dan Strong" 2003)
  4. Re: Calculating Age from DB fields ( "Dan Strong" 2003)
  5. Re: Calculating Age from DB fields ( "Dan Strong" 2003)
  6. Re: Calculating Age from DB fields ( CN Stuff 2003)
  7. Re: Calculating Age from DB fields ( Palle Bo Nielsen 2003)
  8. Re: Calculating Age from DB fields ( Palle Bo Nielsen 2003)
  9. Re: Calculating Age from DB fields ( Glenn Busbin 2003)
  10. Calculating Age from DB fields ( Palle Bo Nielsen 2003)
Problems with the correct age was solved by the "floor" math-syntax Thanks to all for the assistance. Palle On 8/12-2003, at 14.32, Dan Strong wrote: > Though if [AgeinYears] < 1, then it will of course, return 0. Is that > what you want? > -Dan > > On Sun, 07 Dec 2003 19:22:43 -0800 > "Dan Strong" wrote: >> ...or you could consolidate your code: >> AgeInYears=[math]floor([AgeInDays]/365.25)[/Math] >> >> -Dan >> >> >> On Sun, 07 Dec 2003 14:26:32 -0800 >> "Dan Strong" wrote: >>> This is off the cuff and specific only to the method of rounding >>> something down in WebDNA... I haven't been following this thread... >>> hopefully this helps, if not, simply ignore :) >>> >>> [math]floor([AgeInYears])[/math] >>> >>> -Dan >>> >>> >>> >>> On Sun, 7 Dec 2003 22:01:18 +0100 >>> Palle Bo Nielsen wrote: >>>> The code you wrote workes just fine, but I need to round the result >>>> down. >>>> >>>> AgeInYears should be rounded down, and you can not do that with the >>>> format tag or can you. Not according to the docs. >>>> >>>> Any help in rounding down? >>>> >>>> Palle >>>> >>>> >>>> On 6/12-2003, at 16.36, Glenn Busbin wrote: >>>> >>>>>> Hi all, >>>>>> >>>>>> Some how my heads isn't working today, so I hope someone will be >>>>>> helpful... >>>>>> >>>>>> I have a profile database with a lot of personal profile info >>>>>> including these three fields >>>>>> >>>>>> db_date (01...31) >>>>>> db_month (01...12) >>>>>> db_year (1900...2010) >>>>>> >>>>>> I want to calculate the actual date based on todays date. >>>>>> >>>>> >>>>> You mean you want to calc the *age*, right? >>>>> >>>>> Use days to date. >>>>> >>>>> AgeInDays=[math]([math]{[date]}[/Math])-([math]{[db_month]/ >>>>> [db_date]/ [db_year]}[/Math])[/Math] >>>>> >>>>> AgeInYears=[math]AgeInDays/365.25[/Math] >>>>> >>>>> ------------------------------------------------------------- >>>>> 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://webdna.smithmicro.com/ >>>>> >>>>> >>>> >>>> -- >>>> Venlig hilsen >>>> Palle B. Nielsen (PowerPalle) >>>> http://www.macnyt.dk/ >>>> >>>> >>>> >>>> ------------------------------------------------------------- >>>> 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://webdna.smithmicro.com/ >>> >>> ------------------------------------------------------------ >>> http://www.StrongGraphicDesign.com >>> http://www.SearchBoise.com >>> (208) 319-0137 | Toll-free p/f 877-561-1656 >>> ------------------------------------------------------------ >>> >>> ------------------------------------------------------------- >>> 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://webdna.smithmicro.com/ >> >> ------------------------------------------------------------ >> http://www.StrongGraphicDesign.com >> http://www.SearchBoise.com >> (208) 319-0137 | Toll-free p/f 877-561-1656 >> ------------------------------------------------------------ >> >> ------------------------------------------------------------- >> 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://webdna.smithmicro.com/ > > ------------------------------------------------------------ > http://www.StrongGraphicDesign.com > http://www.SearchBoise.com > (208) 319-0137 | Toll-free p/f 877-561-1656 > ------------------------------------------------------------ > > ------------------------------------------------------------- > 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://webdna.smithmicro.com/ > > -- Venlig hilsen Palle B. Nielsen (PowerPalle) http://www.macnyt.dk/ ------------------------------------------------------------- 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://webdna.smithmicro.com/ Palle Bo Nielsen

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:

Problems with webcat 2.01 for NT (1997) Size/Color Options (2002) Execute Applescript (1997) Search in 2 or more catalogs (1997) Bug Report in the docs or? Listfields WebDNA 4.5 (2002) Re:2nd WebCatalog2 Feature Request (1996) Sample Tearoom Search Error (1997) Problems passing [SKU] with $Replace in 2.0 (1997) [REFERRER] AND Truncation (1998) Round up prices (2000) lookup (1998) How do I handle extra spaces? (2002) Webcatalog/NT dbserver crashing. (2000) Limit on amount of data browsers can parse? (2003) Emailer (WebCat2) (1997) WebCat2b13MacPlugIn - more [date] problems (1997) Shipping still a problem!! (1998) 4.5.1 download link (2003) autosensing lanague selection (1997) Extended [ConvertChars] (1997)