| List: | MySQL ODBC | « Previous MessageNext Message » | |
| From: | Daniel J. Summers | Date: | July 4 2003 11:52pm |
| Subject: | Re: Inserting Date Field | ||
| View as plain text | |||
(Ed - I know I sent this to you privately - I meant to post it to the list as well...) Ed Kraft wrote: >How do I insert a date field into my mySQL db? I had it working with >Access (using the date()) function. Now after looking here: > >http://www.mysql.com/doc/en/Date_and_time_functions.html > >I see that it has to be done differently. I've tried using the CURDATE >function, but that doesn't do anything within my ASP pages. > Try INSERT INTO My_Table (My_Date) VALUE (CURRENT_DATE) This will give you the current date. If you're wanting it formatted, your best bet is to write a little function in ASP to format yyyy-mm-dd (with leading zeroes). (There is also a CURRENT_TIME and CURRENT_TIMESTAMP, if you need those formats.) You've seen the response of others as well, using MySQL's date format functions... :) -- Daniel J. Summers DanielJS@stripped -- Daniel J. Summers DanielJS@stripped <mailto:DanielJS@stripped>
| Thread | ||
|---|---|---|
| • rs.delete won't fly | joe speigle | 2 Jul |
| • RE: rs.delete won't fly | Mike Hillyer | 2 Jul |
| • RE: rs.delete won't fly | joe speigle | 2 Jul |
| • RE: rs.delete won't fly | Ed Carp | 2 Jul |
| • RE: rs.delete won't fly | joe speigle | 2 Jul |
| • RE: rs.delete won't fly | Ed Carp | 2 Jul |
| • RE: rs.delete won't fly | Mike Hillyer | 2 Jul |
| • Inserting Date Field | Ed Kraft | 3 Jul |
| • RE: Inserting Date Field | Kyle Holder | 3 Jul |
| • RE: Inserting Date Field | Ed Kraft | 3 Jul |
| • RE: Inserting Date Field | Kyle Holder | 3 Jul |
| • RE: Inserting Date Field | Ed Kraft | 3 Jul |
| • RE: Inserting Date Field | Kyle Holder | 3 Jul |
| • RE: Inserting Date Field | Scott Nichols | 3 Jul |
| • RE: rs.delete won't fly | Mike Hillyer | 2 Jul |
| • Re: Inserting Date Field | Michael Viron | 4 Jul |
| • Re: Inserting Date Field | Daniel J. Summers | 5 Jul |
| • RE: Inserting Date Field | jbonnett | 7 Jul |
