Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tony Kiernan 278 posts 341 karma points
    Jun 18, 2013 @ 16:48
    Tony Kiernan
    0

    Using ExpireDate

    Im trying to get a query to work like this:

    Model.Children.Where("Visible").Where("ExpireDate > DateTime.Now").OrderBy("CreateDate descending");

    It's not happy.  Any ideas?

    (Yes, I know it's horrible.  But, the feed from the client keeps including 'expired' content, so it gets republished with an expiry date in the past)

  • Jeavon Leopold 3074 posts 13631 karma points MVP 11x admin c-trib
    Jun 19, 2013 @ 22:35
    Jeavon Leopold
    0

    Hi Tony,

    I think you just need to combine your 2 .Where methods into 1, so you would have:

    Model.Children.Where("Visible && ExpireDate > DateTime.Now").OrderBy("CreateDate descending");

    Hope that sorts it out?

    Thanks,

    Jeavon

  • Jeavon Leopold 3074 posts 13631 karma points MVP 11x admin c-trib
    Jun 19, 2013 @ 22:43
    Jeavon Leopold
    0

    Just wanted to confirm that ExpireDate is a custom property you have added to your document type and you're not trying to access the standard "Remove At" date property?

Please Sign in or register to post replies

Write your reply to:

Draft