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-syntaxThanks to all for the assistance.PalleOn 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 hilsenPalle 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:
Problems with the correct age was solved by the "floor" math-syntaxThanks to all for the assistance.PalleOn 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 hilsenPalle 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:
[WebDNA] WebDNA 7 (2011)
WebSite and *NO* Authentication Dialog Box!!? (1998)
[HIDEIF] inside [FOUNDITEM] (1997)
[addlineitems] (1997)
Upgrade Installation (1998)
Cart sweeper (2000)
removelineitems (2000)
WCf2 and nested tags (1997)
Forms Search Questions (1997)
PROBLEM (1997)
[WebDNA] Google map mashups (2010)
[WebDNA] Anchors (2010)
Initiating NewCart (1997)
Store Example to Use (1998)
Running _every_ page through WebCat-error.html (1997)
URGENT: NO BUG, woFIELDdata & FIELDword=ww (2002)
HTML Editors (1997)
WebDNA on RedHat ES 4 (2007)
Categories and Sub-categories (2003)
Explorer 3.0/ Access Denied! (1997)