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 ListFilter out records before today on User Defined Table Filter out records before today on User Defined Table
Previous
 
Next
New Post
4/5/2009 11:04 PM
 

I have a field on user defined table called "Date of Event"

I want to filter out all the events that have passed (i.e. all the events from before "Today")

I can't figure out the filter statement.

[Date of Event]<#4/5/2009# works, for example... but obviously I don't want to update the filter every day.

Is there a way to filter

[Date of Event]<Today -- can't seem to find a statement that works.

??

 
New Post
4/6/2009 5:11 AM
 

with help from Stefan Cullmann, i was able to solve that like this:

  • first define a new calculated column in UDT with the name "IsInFuture". The calculation of this column is: 
    (Datum_udt_ticks +864000000000 ) >[ticks:today]
  • Next, in the XSL template, you can filter on the value of the IsInFuture column. ON www.sdn.nl we did that like this:
      <xsl:template match="/udt:UserDefinedTable">
        <xsl:variable name="currentData" select="udt:Data[udt:IsInFuture='true']" />
        <table class="FrontAgendaTable">
          <xsl:apply-templates select="$currentData" mode="list">
            <xsl:sort select="*[name()=$orderBy]" order="{$orderDirection}" data-type="{$orderType}" />
          </xsl:apply-templates>
        </table>
      </xsl:template>

Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
4/7/2009 7:30 PM
 

Thanks for reply, Erik

I tried your suggestions. The calculated column does not work. It says it can't convert date to Int32, and a slew of other errors with different data types.  It also can't use + sign or > sign in the expression.

I tried with data type as Text, Integer, Decimel, Date and Time, True/False... none worked.

 

Here's what I thought should work

([Date of Event] + 864000000000)>[ticks:today]

 

I guess I need to know how to convert [Date of Event] column into an integer...

 

 
New Post
4/8/2009 4:04 AM
 

 you need to convert the date to ticks, please check out the UDT user manual for details.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
4/8/2009 7:28 PM
 

Much easier than I thought. Thanks Sebastian.

I didn't really understand how to use Ticks till now.

The filter statement I used was:

([Date of Event_UDT_Ticks]+864000000000)>[ticks:today]

I did not even need to make a hidden column.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListFilter out records before today on User Defined Table Filter out records before today on 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