By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,792 Members | 1,629 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,792 IT Pros & Developers. It's quick & easy.

Validate Date range

P: 25

I have a couple of textboxes where I enter a date range (From - To), I need to validate that the Date From is greater (future) or at least equal to the Date From, or else give an error.
I almost made it work, when I use the same format in the year (2 digits, or 4 digits) in both dates, but when one of them has a 2 digit year and the other 4 digit year, it does not work??

Is there a simple way to do this? I've been looking in internet but so far I have not found any solution to this specific problem.

Date From: 10/9/2008 Date To: 10/8/2008 <- works fine, I get the error
Date From: 10/9/08 Date To: 10/8/2008 <- not working

same thing when the 2 year digit is in Date To.

I hope somebody can help me with this issue.
Oct 9 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,639
you could use a regex or some string functions to make all 2 digit years 4 digits and apply the validation afterwards.

Oct 9 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.