|
| |
|
|
crosscreek
Posts: 107 Joined: 2/5/2008 Status: offline
|
Update partical dates - 3/18/2008 23:22:48
I am fine tuning some of the pages. I have the editdog.asp page where some can type in the month day & year of a dog's birthdate. (each in seperate textboxes) The info goes to the editdogsubmit.asp page where I am combining the date numbers in a format that mysql likes yyyy-mm-dd BM = request.form("BM") BD = request.form("BD") BR = request.form("BYR") DOB= '" & BR & "-" & BM &"-"& BD &"', Works great except if you leave a box blank (for instance if someone doesn't know the exact day in which a dog was born) I tried making a statement where if " " then replace the " " with 0, (using the replace value) but naturally I would get the result of that (because the 0 is a null value) I tried the below BM = replace(request.form("BM"),"","'00'") and still get DOB= '1974--28', WHERE ID= 1 tried with "0" & '0' and when the update sql is executed it makes the date field blank (or back to all. Is there a way that I can update the date even if someone leaves part of the date blank? I read about Allow_invalid_dates in mysql, but can't seem to get that to work either. Thanks
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Update partical dates - 3/19/2008 9:59:57
I think you're close. How about defaulting to a '1' instead of a '0'. There is no day 0 but there is a day 1. That make sense? That help?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
crosscreek
Posts: 107 Joined: 2/5/2008 Status: offline
|
RE: Update partical dates - 3/19/2008 16:55:56
I guess that would work for the day but not sure about the month & year. Month could also be 1. If anything I can make a statement saying that they must have a year for the date to be valid.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Update partical dates - 3/19/2008 17:14:50
quote:
If anything I can make a statement saying that they must have a year for the date to be valid If it were me, I'd use Month and Year and default the day but I'd think they'd all at least know the month and year (or an educated guess anyways). Maybe even use dropdowns to enforce data integrity so all you need to do is confirm a selection and you don't have to worry whether it's the right format or not. Just possibly how I might approach it. Hope it helps.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
crosscreek
Posts: 107 Joined: 2/5/2008 Status: offline
|
RE: Update partical dates - 3/19/2008 18:30:12
Good idea...Didn't think about the drop downs thanks again
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|