June 11, 2004 at 6:11 am
I cannot seem to respond at the original post so here is my responce for serious date problem.
1) The user enters date as text (No control if the day is less than 13) ie. The day and month could be switched by user. (try use a calander control)
This is how I debug
If I cannot replicate error on test and its very urgent...
On production copy the page(s) with a new name to the server.
response.write the actual command string that inserts the data.
Copy the command string and paste it into Query Analyser and execute.(Sometimes this has to be on the production server)
You will then know where the bug in coming in - Front or Back End
I only use production when its very urgent and I have checked all of the date formats on both the front end and back end servers. Most times you will have to tweak the date at SQL server (swop day and month)
Andy.
June 12, 2004 at 9:46 am
Sukhoi,
I can't post back to your original post, either... I did take a look at the code you posted and all I can say is ...
Daaannnnng that's a lot of math... not sure why you went through all of that because if you save the date into a DATETIME column, the column will only accept dates. If you need to do a check before the save to give the user some feed back, couldn't you just use the ISDATE function instead of all that math with the leap year calcs and all?
Another thing... you mentioned that your date format is DD/MM/YYYY... did you know that the CONVERT function will also allow you to identify what the format of an input is? For example, this works for the format you mentioned...
2004-06-30 00:00:00.000
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply