Copied to clipboard

Flag this post as spam?

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


  • Johan 95 posts 264 karma points
    Dec 11, 2015 @ 09:40
    Johan
    0

    Check old dates

    Right now I have a code that checks for only future dates

    var times = school.Children.Where("date > DateTime.Now.Date").OrderBy("date");
    

    This code works perfectly.

    However, now I want to include dates that are six months old as well, how would that code look like?

  • TheOriginal 22 posts 122 karma points
    Dec 11, 2015 @ 11:50
    TheOriginal
    0

    Try this:

    var times = school.Children.Where("date > CreateDate && date > DateTime.Now.Date").OrderBy("date");
    

    I'm not sure what value date is returning but using date as you've used above this might work. Please reply if not so I can take another look.

  • Johan 95 posts 264 karma points
    Dec 11, 2015 @ 12:17
    Johan
    0

    How would that code include dates that are 6 months from current time?

Please Sign in or register to post replies

Write your reply to:

Draft