Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListCalculate Age by D.O.B columnCalculate Age by D.O.B column
Previous
 
Next
New Post
3/29/2008 8:02 AM
 

Hi,

I'm new to DNN and User Defined Tables.... perhaps you can help!?

I have a Date of Birth column which is obviously set to date type. I have another column for "age". This column is set up as a calcuated column. Is it possible to work out the age using an expression?

If so please advise?

Many thanks

 
New Post
3/29/2008 9:10 AM
 

it should be possible to use a (hidden) calculated column of datatype DateTime with value of Now and another one substracting date of birth from it, displaying year only. 


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
3/29/2008 2:17 PM
 

Hi Sebastian

Thanks for your comments. I've read posts about hidden fields etc... But i'm not sure I even need that?

What I've come up with so far is the following expression:

([Ticks:Now] - [DOB_UDT_Ticks]) / [Ticks:TicksPerDay] / 365

Where [DOB_UDT_Ticks] is the token of my DOB column. My D.O.B is #04/15/1978# which makes me 29 years old today, however the formula rounds up to 30.

Does anyone have any ideas how to stop the expression from rounding up? I think this could be possible using the output format, but not sure how?

Any ideas??

Thanks

 
New Post
3/30/2008 6:24 AM
 

did you try

([Ticks:Now] - [DOB_UDT_Ticks]) / [Ticks:TicksPerDay] \ 365


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
3/30/2008 6:44 AM
 

Try:
([Ticks:Now] - [DOB_UDT_Ticks]) / [Ticks:TicksPerDay] /365.25 -0.5

-0.5    handles rounding issues
.25     includes leap years into calculation (also only an approximation)

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListCalculate Age by D.O.B columnCalculate Age by D.O.B column


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out