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

Validate Date range

vavc1980
P: 25
Hello,

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.

example:
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


Dormilich
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.

regards
Oct 9 '08 #2

Post your reply

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