In database records as follows
MedicalEntryDate
1st Oct 2014
I want to validate MedicalEntryDate should be greater than the Today's Date.
for that how can i do in asp.net using c#.
MedicalEntryDate
1st Oct 2014
I want to validate MedicalEntryDate should be greater than the Today's Date.
for that how can i do in asp.net using c#.
Abhishek KumarPosted Oct 7, 2014, 6:34 AM
if(convert(datetime,REPLACE ('1st oct 2014', 'st', ''),101)>convert(datetime,CONVERT(VARCHAR, GETDATE(), 101),101))
BEGIN
END
Print 1
ELSE
BEGIN
print 2
END
i have used the your value for example .
you can replace it with your column.
Let me knowif you need more on this.
Abhishek
Wim SturkenboomPosted Oct 7, 2014, 6:16 AM
dtNow = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day);
if(MedicalEntryDate >= dtNow.AddDays(1))
{
}
else
{
}
The first two lines calculate the current date. The if statement compares the MedicalEntryDate with tomorrows date (dtNow plus one day).
Not tested, just from the head.