DateTime query in where clause returns no results in pages data source

Eric Conklin asked on September 21, 2020 21:36

I am using the following where clause to query my pages from a blog via a pages data source web part:

'{%EventDate %}' >   '{%GetDateTime(DateTime.Now)#%}'

When this query runs in the pages data source, I get no results even though I have posts that have event dates in the future.

Can anyone provide some insight to this? When I change it to < or <=, every event page shows up that has an event date including dates that are clearly in the future of the current date.

Recent Answers

Juraj Ondrus answered on September 23, 2020 07:30

What does the macro and SQL debug say? I am using just this:
EventDate > '{%DateTime.Now#%}'
And it is working fine. You can see it in action here (default administrator access with no password, will be destroyed on Oct. 1, 2020). I just added the EventDate field to the CMS.News page type to do a quick test sample.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.