473,396 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 11626
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. If I use the same data and insert/update to a MS...
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: Mon Jun 7 10:37:28 EDT 2004 The latest...
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 insert the current_date() and current_time()...
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 : August 1, 2005, 9:09 am EDT October 13, 2004,...
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 in code is in European format dd/mm/yyyy. ...
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 is 2006-00-00. I know about the date()...
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 function. I thought 'global $table;' would solve...
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 retrieves data for the customers customers. If you see...
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 and time separately? I thought it might be
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.