472,347 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,347 software developers and data experts.

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 11586
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: M.C. Scheffers | last post by:
Hello all, I'm developing an VB application which uses the SAX parser and ADO VB to insert.update data in in MySQL. The perormance is very bad....
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated:...
2
by: toedipper | last post by:
Hello, I have the following section of php code which updates a mysql record from a form. For the values of livedate and livetime I need to...
3
by: usenet | last post by:
I have inherited a table where date information was saved from PHP as a VARCHAR. (Sigh.) This means that the so-called date fields look like this :...
2
by: Paul | last post by:
I am trying to insert a date into a mysql table but everytime I attempt it the date field is always empty. The field is of Date type and the date...
11
by: walterbyrd | last post by:
My MySQL table has a field that is set as type "date." I need to get today's date, and insert it into that field. The default for that MySQL field...
5
by: strawberry | last post by:
In the function below, I'd like to extend the scope of the $table variable such that, once assigned it would become available to other parts of the...
9
by: TC | last post by:
Hi. I have some ASP written in VB.net which is currently installed on a customers server. The asp connects to a local MySql database and...
6
by: Geoff Cox | last post by:
Hello, at the moment I can add the combined date and time into MySQL using php $dt1 = date("Y-m-d H:i:s"); is it possible to add the date...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.