More in this section

Forums / General Discussions / How do I use specific dates in a NewsView's FilterExpression?

How do I use specific dates in a NewsView's FilterExpression?

2 posts, 1 answered
  1. Hahn
    Hahn avatar
    11 posts
    Registered:
    22 Mar 2011
    27 Apr 2011
    Link to this post
    see this post for background: http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/how-to-create-queryitems.aspx

    I now need to be able to specify a date range in this FilterExpression.  I've tried using strings, DateTimes converted to strings, and various other things in place of "DateTime.UtcNow" in the example and they all break the expression when it's being parsed.   How do I use specific dates in this FilterExpression?


    Also, are there any resources on how to write FilterExpressions in SF 4.x?  I haven't been able to find any.

    Thank you
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    29 Apr 2011
    Link to this post
    Hi Hahn,

    You can use the following syntax ( example with events)

    Visible = true AND Status = Live AND EventStart > (01/01/2011) AND EventEnd < (04/01/2011)

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
2 posts, 1 answered