RE: Default Date and Time

2009-06-26 Thread Jerry Schwartz
>-Original Message- >From: Jason Todd Slack-Moehrle [mailto:mailingli...@mailnewsrss.com] >Sent: Friday, June 26, 2009 1:10 PM >To: mysql@lists.mysql.com >Subject: Default Date and Time > >Hi All, > >I want to create a table that defaults to current_date and c

Re: Default Date and Time

2009-06-26 Thread Max Bube
Hi Jason The DEFAULT value can't be an expression. 2009/6/26 Jason Todd Slack-Moehrle > Hi All, > > I want to create a table that defaults to current_date and current_time. > > I have: > > CREATE TABLE `personalevent`( >`pevent` mediumint(10) NOT NULL, >`eventid` mediumint(10)

Default Date and Time

2009-06-26 Thread Jason Todd Slack-Moehrle
Hi All, I want to create a table that defaults to current_date and current_time. I have: CREATE TABLE `personalevent`( `pevent` mediumint(10) NOT NULL, `eventid` mediumint(10) NOT NULL, `userid` mediumint(10) NOT NULL, `username` varchar(10) NOT NULL, `pa

Re: how to default ... DATE column to another column date field, without using a trigger?

2006-05-19 Thread Ferindo Middleton
I have a similar desire like my first question regarding a DATETIME field. I have a DATETIME field in my db that I would like to DEFAULT to the exact value of another DATETIME field in the same table... However, if I write a trigger for this and the application or the user or someone accessing the

RE: changing default date format on server

2005-03-24 Thread Tom Crimmins
t; > PS - Sorry it took me so long Mark, was busy and AFK > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 24, 2005 10:57 AM > To: Mark Mchugh > Cc: mysql list > Subject: Re: changing default date format on server

RE: changing default date format on server

2005-03-24 Thread J.R. Bullington
AIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 10:57 AM To: Mark Mchugh Cc: mysql list Subject: Re: changing default date format on server Mark Mchugh <[EMAIL PROTECTED]> wrote on 03/24/2005 10:26:44 AM: > hi, > How can i change the default date field to european f

Re: Default Date Format

2005-03-24 Thread Gleb Paharenko
Hello. This is a frequently asked question. For example read these threads: http://lists.mysql.com/mysql/175324 http://lists.mysql.com/mysql/177730 Shuan <[EMAIL PROTECTED]> wrote: > Dear all, > > How to change the Default Date/DateTime Format of MySQL

Default Date Format

2005-03-23 Thread Shuan
Dear all, How to change the Default Date/DateTime Format of MySQL server? I'm using MySQL 4.1.10-nt on WinXP Pro. Thanks. Shuan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Default date format

2004-12-27 Thread jakub
> Is there a way how to change the date and time format accepted and > returned by MySQL from '-mm-dd' to something different? I've seen > several posts here telling it's impossible but they are quite old. Is > it still true in recent MySQL versions? I can see date_format, > datetime_format and

Default date format

2004-12-27 Thread Jakub Vrana
Hello! Is there a way how to change the date and time format accepted and returned by MySQL from '-mm-dd' to something different? I've seen several posts here telling it's impossible but they are quite old. Is it still true in recent MySQL versions? I can see date_format, datetime_format and t

Re: Default DATE field values

2004-01-04 Thread Chris Nolan
;t want it update > when you UPDATE the row, you can just set it to its current value, if > you weren't aware of that. > > > Matt > > > - Original Message - > From: "Chris Nolan" > Sent: Saturday, January 03, 2004 10:34 AM > Subject: Defau

Re: Default DATE field values

2004-01-03 Thread Matt W
rrent value, if you weren't aware of that. Matt - Original Message - From: "Chris Nolan" Sent: Saturday, January 03, 2004 10:34 AM Subject: Default DATE field values > Hi all, > > Upon reading the funky manual, I have discovered the following things: > >

Default DATE field values

2004-01-03 Thread Chris Nolan
Hi all, Upon reading the funky manual, I have discovered the following things: 1. TIMESTAMP fields can be set so that their default value is NOW(). 2. DATE and TIMESTAMP fields are related. Given the two above facts, is there a way to set DATE columns so the default value is NOW()? My playing ar

Re: Insert default Date

2002-10-15 Thread Jim Lundeen
TIMESTAMP does what you want, but if you for any reason wish to update records (mass updates) at the mysql> prompt without updating the TIMESTAMP, you'd be out of luck. For databases where I know that mass updates to data files will be required, and I want to preserve the user's LAST_MODIFIED (TI

RE: Insert default Date

2002-10-15 Thread Artem Koltsov
You can use TIMESTAMP field for this. It's automatically assigned current date if you don't insert anything in this field type or insert null. -Original Message- From: Arthur [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 7:56 AM To: MYSQL Subject: Insert de

re: Insert default Date

2002-10-15 Thread Victoria Reznichenko
Arthur, Tuesday, October 15, 2002, 2:56:13 PM, you wrote: A> In access Now() as table field default sets the field when a new A> record is created. In SQL Server there is getdate() & suser_sname() You can't use the return value of a function as a default value. A> Is there an equivalent f

RE: Insert default Date

2002-10-15 Thread Matthew Smith
In Mysql (http://www.mysql.com/doc/en/Date_and_time_functions.html) funnily enough: NOW() orSYSDATE() will return what you want. Regards M -Original Message- From: Arthur [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 12:56 To: MYSQL Subject: Insert default Date

Insert default Date

2002-10-15 Thread Arthur
Hello MYSQL, In access Now() as table field default sets the field when a new record is created. In SQL Server there is getdate() & suser_sname() Is there an equivalent for MySQL? -- Best regards, Arthur mailto:[EMAIL PROTECTED] ---

Re: default date time insertion in the database

2002-09-26 Thread Josh Trutwin
> Hi, > > can anyone tell me how can i set the default datetime as current > datetime in the mysql. so that every time i insert a record in the table > current datetime automaticall inserted. > Thanks in advance. >From MySQL manual section 6.5.3: "Default values must be constants. This means, fo

re: default date time insertion in the database

2002-09-26 Thread Victoria Reznichenko
Daya, Thursday, September 26, 2002, 7:53:46 AM, you wrote: DKD> can anyone tell me how can i set the default datetime as current datetime in DKD> the mysql. so that every time i insert a record in the table current DKD> datetime automaticall inserted. DKD> Thanks in advance. Take a look at TIMES

default date time insertion in the database

2002-09-25 Thread Daya Krishan Dubey
Hi, can anyone tell me how can i set the default datetime as current datetime in the mysql. so that every time i insert a record in the table current datetime automaticall inserted. Thanks in advance. Regards Daya Krishan Dubey Core Solucomm Ltd 423 B, Hamilton court DLF phase IV Gurgaon, India

RE: sysdate or curdate as default date in mysql

2002-09-02 Thread Chugh Shalini
Thankx for the reply Egorov,Hillyer and Neil. Timestamp has solved my purpose. Actually we are porting an application from oracle to mysql. In Oracle there were some tables which were using sysdate as default date, therefore we wanted something similar functionality, as it was very difficult to

Re: sysdate or curdate as default date in mysql

2002-09-02 Thread Egor Egorov
Chugh, Monday, September 02, 2002, 3:41:27 PM, you wrote: CS> Can we define sysdate or curdate as default date for a column of CS> datatype 'date' while creating a table? You can't define result of function as a default value. Take a look at TIMESTAMP c

Re: sysdate or curdate as default date in mysql

2002-09-02 Thread DL Neil
Dear Chugh, > Can we define sysdate or curdate as default date for a column of > datatype 'date' while creating a table? The question is ambiguous: - if a table is created with a column defined to be a TIMESTAMP data type, then every time a row is INSERTed or UPDATEd, the curr

RE: sysdate or curdate as default date in mysql

2002-09-02 Thread Mike Hillyer
performed. Mike -Original Message- From: Chugh Shalini [mailto:[EMAIL PROTECTED]] Sent: Monday, September 02, 2002 6:41 AM To: [EMAIL PROTECTED] Subject: sysdate or curdate as default date in mysql Dear All! Can we define sysdate or curdate as default date for a column of datatype

sysdate or curdate as default date in mysql

2002-09-02 Thread Chugh Shalini
Dear All! Can we define sysdate or curdate as default date for a column of datatype 'date' while creating a table? Regards Sql, mysql, query - Before posting, please check: http://www.mysql.com/manual.

problem creating table with default date

2002-08-04 Thread Eric Ray
I'm using the following DDL statement: create table if not exists dbname.tablename ( ..., the_datedate not null default current_date ); I receive the following error message: ERROR 1064: You have an error in your SQL syntax near 'current_date, I'm been l

Re: How Can I Set CurrentDate As Default Date

2001-10-31 Thread Carl Troein
sreedhar writes: > CREATE TABLE XX(..,fldDate DATETIME DEFAULT NOW() NOT NULL, ..); > > NOW() & CURDATE() both will give Current date. But I am getting syntax > error. > > If i give some Date like 10/31/2001 it is taking as default. You didn't bother to search the manual, did you? In the chap

How Can I Set CurrentDate As Default Date

2001-10-31 Thread sreedhar
hello, I got problem when I tried to have CURRENTDATE as DEFAULT date. For this I gave sql statement as CREATE TABLE XX(..,fldDate DATETIME DEFAULT NOW() NOT NULL, ..); NOW() & CURDATE() both will give Current date. But I am getting syntax error. If i give some Date like 10/31/2001 i

RE: Default date format

2001-07-17 Thread Warren van der Merwe
) 767-0249 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > ]On Behalf > Of pak > Sent: 18 July 2001 08:58 > To: [EMAIL PROTECTED] > Subject: Default date format > > > Is there a default format for Date ? > /mm/dd or > mm

Default date format

2001-07-17 Thread pak
Is there a default format for Date ? /mm/dd or mm/dd/ or dd/mm/ ? I am not sure which format I should use in SQL. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mys

Re: Default Date

2001-05-24 Thread Cal Evans
I believe this is clearly explained in the manual at www.mysql.com Cal - Original Message - From: "Eugénio Veiga" <[EMAIL PROTECTED]> To: "MySQL" <[EMAIL PROTECTED]> Sent: Thursday, May 24, 2001 9:17 AM Subject: Re: Default Date > Hi > > Paul

Re: Default Date

2001-05-24 Thread Eugénio Veiga
Hi Paul DuBois wrote: > On Thu, May 24, 2001 at 12:24:53PM +0100, Eugénio Veiga wrote: > > Does any body know, how to put the date of the server in a date field of > > a Table in the database by > > default? > > > > Thanks > > What is "the date of the server"? > The server date, the date of the

Re: Default Date

2001-05-24 Thread Paul DuBois
On Thu, May 24, 2001 at 12:24:53PM +0100, Eugénio Veiga wrote: > Does any body know, how to put the date of the server in a date field of > a Table in the database by > default? > > Thanks What is "the date of the server"? - Be

Default Date

2001-05-24 Thread Eugénio Veiga
Hi Does any body know, how to put the date of the server in a date field of a Table in the database by default? Thanks - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/

RE: Default Date value

2001-03-26 Thread Cal Evans
48 PM To: Cal Evans; MYSQL Subject: RE: Default Date value Is it possible to set a function as a default value for a column at all. I apologize if I come off a bit dumb about this but I come from an MSSQL background where you can set a default to a function. Thanks Again -Original Message-

Re: Default Date value

2001-03-25 Thread Jeremy D . Zawodny
On Sun, Mar 25, 2001 at 10:47:41PM -0700, Michael Blood wrote: > > Is it possible to set a function as a default value for a column at > all. I apologize if I come off a bit dumb about this but I come > from an MSSQL background where you can set a default to a function. You cannot. -- Jeremy D.

RE: Default Date value

2001-03-25 Thread Michael Blood
, March 25, 2001 4:06 PM To: Michael Blood; MYSQL Subject: RE: Default Date value BlankI don't think you can do that with a default value. You will need to include the current date in your insert statement. Cal http://www.calevans.com -Original Message- From: Michael Blood [m

RE: Default Date value

2001-03-25 Thread Cal Evans
bject: Default Date value I am trying to set the default value in a date field to be the time that it was created However I do not want the field to be a timestamp because I want to update it to a different value later. I have looked through the mysql documentation and I can not seem to

Default Date value

2001-03-25 Thread Michael Blood
Title: Blank I am trying to set the default value in a date field to be the time that it was created However I do not want the field to be a timestamp because I want to update it to a different value later.   I have looked through the mysql documentation and I can not seem to find anywhere t