469,923 Members | 1,333 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

ASP - date formating MySql insert/update

I am storing dates in a mySql database in the format yyyy-mm-dd.
Now, I have set up so that this field is insert by a form.
It isn't very user friendly to have to type yyyy-mm-dd, how can I set up so
that the user
can enter format dd/mm/yyyy and it will automatically insert into the
database as yyyy-mm-dd?

I am using Dreamweaver MX 2004 and ASP.

Thanks for any helps to me ....
Vivian

Jul 19 '05 #1
5 11532
Hi Vivian,

sDate = Request.Form("year") & "-" & request.form("month") & "-" &
Request.form("day")
sSQL = "insert into yourTable (theDate) values ('" & theDate & "')"

You'd want to validate the data or only give people dropdown boxes from
which to select so that they have to pick a valid date. Also, I do not know
that ' is the right delimiter for dates in MySQL.

Ray at work
"- - Vivian - - - - - -" <vi*********@ligbr.com.br> wrote in message
news:ee**************@tk2msftngp13.phx.gbl...
I am storing dates in a mySql database in the format yyyy-mm-dd.
Now, I have set up so that this field is insert by a form.
It isn't very user friendly to have to type yyyy-mm-dd, how can I set up so that the user
can enter format dd/mm/yyyy and it will automatically insert into the
database as yyyy-mm-dd?

I am using Dreamweaver MX 2004 and ASP.

Thanks for any helps to me ....
Vivian

Jul 19 '05 #2
> It isn't very user friendly to have to type yyyy-mm-dd,

Don't allow free text date entry. Have them pick the month, day and year
from three different dropdowns. Much less validation required, and you can
format the input however you like.
Jul 19 '05 #3
Vivian - listen to Foo - that was profound advice.
I nearly went insane trying different systems in Javascript/Asp,
wasted months on it - there is nothing quite as effective as the three
dropdowns Foo advocates. It works everytime, never get a wrongly
formatted date, a dream to validate
Kenny
Don't allow free text date entry. Have them pick the month, day and year
from three different dropdowns. Much less validation required, and you can
format the input however you like.


Jul 19 '05 #4
Please send links about scripts javascript for
dropdown calendars...

Thanks

Vivian

Vivian - listen to Foo - that was profound advice.
I nearly went insane trying different systems in Javascript/Asp,
wasted months on it - there is nothing quite as effective as the three
dropdowns Foo advocates. It works everytime, never get a wrongly
formatted date, a dream to validate
Kenny
Don't allow free text date entry. Have them pick the month, day and year
from three different dropdowns. Much less validation required, and you canformat the input however you like.

Jul 19 '05 #5
Some good links here
http://www.aspfaq.com/show.asp?id=2309

"- - Vivian - - - - - -" <vi*********@ligbr.com.br> wrote in message
news:eh**************@tk2msftngp13.phx.gbl...
Please send links about scripts javascript for
dropdown calendars...

Thanks

Vivian

Vivian - listen to Foo - that was profound advice.
I nearly went insane trying different systems in Javascript/Asp,
wasted months on it - there is nothing quite as effective as the three
dropdowns Foo advocates. It works everytime, never get a wrongly
formatted date, a dream to validate
Kenny
Don't allow free text date entry. Have them pick the month, day and yearfrom three different dropdowns. Much less validation required, and you canformat the input however you like.


Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by M.C. Scheffers | last post: by
reply views Thread by Mike Chirico | last post: by
2 posts views Thread by toedipper | last post: by
11 posts views Thread by walterbyrd | last post: by
9 posts views Thread by TC | last post: by
6 posts views Thread by Geoff Cox | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.