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 ListDate Calculations in User Defined TableDate Calculations in User Defined Table
Previous
 
Next
New Post
12/3/2007 11:25 PM
 

Hello,

I have a simle UDT defined which I am using as a Work Order tracking System.  I have a column for the Date the job was entered (let's call it Date).

What I need to do is to be able to calculate the age of the record (in days), based on the difference between the date entered, and the current system date.  In VB, I would do a Datediff("d",Date,Now()).  I have tried creating a calculated field in the table, and putting an expression of datediff("d",Date,[DateTime:Now]) and get an error message saying the function is not defined.

Is there another way this can be achieved?  I am using UDT Version 3.4.0.

Regards

Steve Teece

ABC Business Solutions

 
New Post
12/4/2007 3:41 AM
 

UDT's calculated column is based on datacolumn.expression, and unfortunately it doesn't support any Date functions. We realized this limitations and, as we can't add new functions inside, we are able to tweak in a different  way.

Let's say your UDT has a column "Date". Behind the scences UDT has already creaded two additional columns: Date_UDT_Value which contains the localized date as string and  Date_UDT_Ticks which is the long integer representation of your Date and build into the .Net framework.

The calculated column can also refer some tokens that are injected at runtime.

So the expression you ask for is:

([Ticks:Now] - [Date_UDT_Ticks]) / [Ticks:TicksPerDay]

 

 
New Post
12/5/2007 7:40 PM
 

Hi Stefan,

Thanks for the expression - it works perfectly and is exactly what I was trying to achieve.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListDate Calculations in User Defined TableDate Calculations in User Defined Table


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