I want to perform this date check:
The date entered by the user should not be less than 12 months ago from the current date, e.g.
if date_value > '03-apr-2009'
How do I write .NET code to do this?
EDIT:
date_value which i’m entering is in string format
[ as i did casting already as ( (System.DateTime)date_value).ToString(‘dd-MMM-yyyy’) ]
so now i want to make a comparision with this string (date_value) and DateTime.Now.AddYears(-1))
so can two strings be compared as such ???? (if one date value is > than the other)
OR Should i do any casting for the comparision ?
Do you mean something like the following code?