Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi All,
I have created a query to find all events.
Each event has a date time control
Can I create a query, when given a certain date will find all dates after(and including) that date and then display them
To find all events this query works
var nodes = Model.Content.Site().FirstChild("eventsPage").Children("eventsItem").Where(x => x.IsVisible()).OrderBy("CreateDate desc");
I then just loop through the node.
I'm sure i need to put in the WHERE clause, but do not know the syntax.
Also how to order by the date parameter would be awesome as well.
How can I specify a parameter to search?
Hi James
if your special property has an alias 'eventDate' for example then would the following work?
var cutOffDate = DateTime.Now; var nodes = Model.Content.Site().FirstChild("eventsPage").Children("eventsItem").Where(x => x.IsVisible() && x.HasProperty("eventDate") && x.HasValue("eventDate") && x.GetPropertyValue<DateTime>("eventDate") > cutOffDate).OrderByDescending(x=>x.GetPropertyValue<DateTime>("eventDate"));
regards
Marc
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Custom Query - Select all entries after a specific date from DateTime parameter
Hi All,
I have created a query to find all events.
Each event has a date time control
Can I create a query, when given a certain date will find all dates after(and including) that date and then display them
To find all events this query works
I then just loop through the node.
I'm sure i need to put in the WHERE clause, but do not know the syntax.
Also how to order by the date parameter would be awesome as well.
How can I specify a parameter to search?
Hi James
if your special property has an alias 'eventDate' for example then would the following work?
regards
Marc
is working on a reply...