List:MySQL ODBC« Previous MessageNext Message »
From:Michael Viron Date:July 4 2003 6:18am
Subject:Re: Inserting Date Field
View as plain text  
We had a similar problem with getting asp to insert into an oracle date
field -- ended up using the to_date function in oracle (or setting sysdate
as the default)

At http://www.mysql.com/doc/en/Date_and_time_functions.html, looks like the
one you need is the date_format command, in addition to curdate, hence
something like:

insert into temp (testdate) values (date_format(curdate(),"%Y-%m-%d")

(or very close, I couldn't get it to work consistently)

Or you could also set it as type "TIMESTAMP" which auto-sets the date /
time when something is inserted.

Michael

--
Michael Viron
Core Systems Group
Simple End User Linux

At 09:51 AM 7/3/2003 -0700, Ed Kraft wrote:
>Hey All,
>
>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.
>
>Thanks,
>
>Ed
>
>
>-- 
>MySQL ODBC Mailing List
>For list archives: http://lists.mysql.com/myodbc
>To unsubscribe:    http://lists.mysql.com/myodbc?unsub=1
>
Thread
rs.delete won't flyjoe speigle2 Jul
RE: rs.delete won't flyMike Hillyer2 Jul
  • RE: rs.delete won't flyjoe speigle2 Jul
    • RE: rs.delete won't flyEd Carp2 Jul
  • RE: rs.delete won't flyjoe speigle2 Jul
  • RE: rs.delete won't flyEd Carp2 Jul
RE: rs.delete won't flyMike Hillyer2 Jul
  • Inserting Date FieldEd Kraft3 Jul
    • RE: Inserting Date FieldKyle Holder3 Jul
      • RE: Inserting Date FieldEd Kraft3 Jul
        • RE: Inserting Date FieldKyle Holder3 Jul
          • RE: Inserting Date FieldEd Kraft3 Jul
            • RE: Inserting Date FieldKyle Holder3 Jul
              • RE: Inserting Date FieldScott Nichols3 Jul
RE: rs.delete won't flyMike Hillyer2 Jul
Re: Inserting Date FieldMichael Viron4 Jul
Re: Inserting Date FieldDaniel J. Summers5 Jul
RE: Inserting Date Fieldjbonnett7 Jul