Re: Calculating Age from DB fields
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 54749
interpreted = N
texte = Though if [AgeinYears] < 1, then it will of course, return 0. Is that what you want?-DanOn 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.comhttp://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/
Associated Messages, from the most recent to the oldest:
Though if [AgeinYears] < 1, then it will of course, return 0. Is that what you want?-DanOn 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.comhttp://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/
"Dan Strong"
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:
Absolutely OT: Where's Clearway Technologies? (2000)
Email notification to one of multiple vendors ? (1997)
[OT] Google Info (2004)
Discount solution? (1998)
Trunk-gator (1997)
Cart Number Propagation (1997)
Fwd: Handling Charges (1999)
WebDNA Solutions ... sorry! (1997)
Moment of Thanks (1997)
Authenticating users without dialog box (1997)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
Alcatraz must have been nicer than this... (2000)
[WebDNA] php/mySQL version of WebDNA Speed Test? (2009)
quit command on NT (1997)
Off Topic: MacOS X Server on iMac (2000)
Admin Edit prob. (1997)
WC2.0 Memory Requirements (1997)
WebDNA's current version? (2003)
SOP for WebDNA talk - MSNBot Crashing (2004)
searchable list archive (1997)