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

Date Validation Problems

P: n/a
I am having some validation and insertion problems. I am using a date
picker that takes the selected date and puts it to ("dd-MMM-yyyy") format,
as this was the only format that Oracle would accept on an insert, however,
when it does a comparision validation it is failing. I have

StartDate = comparing to an invisible textbox that contains todays date
EndDate = comparing to StartDate needing to be >=
SetupDate = comparing to StartDate needing to be <=

So how it looks is like this

26-MAY-2004 = text box with Today's date
24-JUN-2004 = StartDate
24-JUN-2004 = EndDate
24-JUN-2004 = SetupDate

This example fails on validation stating that StartDate must be greater than
today's date. I know the problem has to do with the conversion to a string
format where JUN would be less than MAY thus making it invalid. When I use
the ToShortDateString option the validation works but the insert into the
database fails because the format is which oracle is not accepting.
05/26/04
06/24/04
06/24/04
06/24/04

I have tried taking the ToShortDateString and formatting that into another
variable, but it says it can't take a string variable and convert it into
the appropriate dd-MMM-yyyy format. Any ideas on how to get this to compare
for validation correctly and get it to insert into the database?
Nov 16 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.