How to compare date portion of SQL dates in C#

Home Forums Tech Web Development How to compare date portion of SQL dates in C#

This topic contains 0 replies, has 1 voice, and was last updated by  Mr. Mangus 12 years, 2 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2318

    Mr. Mangus
    Participant

    You need to compare, if 2 dates are of the same date.

    You want to ignore time portion of the dates.

    Here is how you do it in C#:

    if (_DateDue.Date == DateTime.Today.Date)

    In this example, we are comparing a variable _DateDue from database with today’s date.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.