Where Condition for Date in Repeater

David Pearson asked on August 1, 2018 19:43

Trying to do a Where Clause in a Repeater. I tried: DocumentIsArchived = 0 && DocumentPublishTo < getdate() with no luck in Kentico 9.

Thanks David

Correct Answer

David Pearson answered on August 1, 2018 21:41

Got it figure out. I needed a datetime string instead of the sql command GetDate(). Also need to use or instead of ||.. New Where Clause DocumentIsArchived = 0 or DocumentPublishTo <= '{% CurrentDateTime.Month.ToString() + "/" + CurrentDateTime.Day.ToString() + "/" + CurrentDateTime.Year.ToString() |(identity)GlobalAdministrator%}'

0 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Mogilnitski answered on August 1, 2018 20:17

Should it be DocumentPublishTo > getdate()?

0 votesVote for this answer Mark as a Correct answer

David Pearson answered on August 1, 2018 20:20

I try the getdate()with no luck.

0 votesVote for this answer Mark as a Correct answer

David Pearson answered on August 1, 2018 20:25

The getdate() generates an error.

0 votesVote for this answer Mark as a Correct answer

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