lobos
asked on
compare date, if less than today
I want to turn on an indicator if this value is less than today's date.
DateTime.Parse(dr["birthda y"].ToStri ng())).ToS tring("MMM -dd-yyyy")
I want to turn on an indicator if this is less than today's day.
How can I do an if statement against the current date?
DateTime.Parse(dr["birthda
I want to turn on an indicator if this is less than today's day.
How can I do an if statement against the current date?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok can this be update the if statement a bit more I need to know if the date entered is equal to Nov.16,2004 then flag it.
I am really bad with the syntact stuff.
Thanks.
I am really bad with the syntact stuff.
Thanks.
DateTime birthday = DateTime.Parse(dr["birthda y"].ToStri ng())).ToS tring("MMM -dd-yyyy") ;
DateTime today = DateTime.Parse(DateTime.No w.ToShortD ateString( ));
if (birthday.CompareTo(today) <0)
// birthday is less than today's date
if (birthday.CompareTo(new DateTime(2004, 11, 16)) == 0)
// birthday is equal to Nov.16th
DateTime today = DateTime.Parse(DateTime.No
if (birthday.CompareTo(today)
// birthday is less than today's date
if (birthday.CompareTo(new DateTime(2004, 11, 16)) == 0)
// birthday is equal to Nov.16th
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if(DateTime.Parse(dr["birt
// birthday is less than today's date
else
// birthday is greater than today's date
Might be a little closer...