473,387 Members | 1,664 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,387 software developers and data experts.

question about datetime column in mysql

Hey there,
i tried this question in the mysql group, but have not heard anything.
i have a database with about 20 tables. The some of these tables have
datetime type columns in them. What i am basically wondering is if
there is a way to make a default value of now() apply if it is not
specified when the row is created.
i know this is possible with a timestamp, but is it possible with a
datetime column ? and if so, how ?

Oct 29 '06 #1
2 1309
nephish wrote:
Hey there,
i tried this question in the mysql group, but have not heard anything.
i have a database with about 20 tables. The some of these tables have
datetime type columns in them. What i am basically wondering is if
there is a way to make a default value of now() apply if it is not
specified when the row is created.
i know this is possible with a timestamp, but is it possible with a
datetime column ? and if so, how ?
Re-ask your question in that newsgroup - it might have gotten lost the
first time (did you wait at least 24 hours for a response?). Or try
another mysql newsgroup - such as comp.databases.mysql - or the mailing
list on mysql.com.

A php newsgroup is not the correct place for MySQL questions.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 29 '06 #2
ok, sorry for that.
shawn

On Oct 28, 10:42 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
nephish wrote:
Hey there,
i tried this question in the mysql group, but have not heard anything.
i have a database with about 20 tables. The some of these tables have
datetime type columns in them. What i am basically wondering is if
there is a way to make a default value of now() apply if it is not
specified when the row is created.
i know this is possible with a timestamp, but is it possible with a
datetime column ? and if so, how ?Re-ask your question in that newsgroup - it might have gotten lost the
first time (did you wait at least 24 hours for a response?). Or try
another mysql newsgroup - such as comp.databases.mysql - or the mailing
list on mysql.com.

A php newsgroup is not the correct place for MySQL questions.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Oct 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phil Powell | last post by:
I have a mySQL database table with a column field datatype of datetime that I set up in the original create table statement like this: create table nnet_usermetadata ( .... nnet_record_entered...
3
by: Phil Powell | last post by:
I am unable to determine which version of mySQL is running on a remote server (and the client doesn't know either, and I can't reach the host.. oh what I'll do for $80)... create table if not...
0
by: PAUL MENARD | last post by:
--0-930715088-1061086093=:22602 Content-Type: text/plain; charset=us-ascii Hello All, I'm having trouble understanding the MySQL docs on how to subtract two DATETIME values. I have two tables...
0
by: Manny | last post by:
Great that worked! I would also like to only provide a date in the where clause and not a timestamp (the field is of type datetime). I have tried using the date function but it does not appear...
3
by: heroe | last post by:
Hello *, i write you with an urgent problem. I would like to create forign keys to datetime field, but it doesn't seem to work. I get Can't create table '.\sampleDB\student_module.frm' (errno:...
13
by: Roy | last post by:
Hi all, I'm creating a project that should always use this date format when displays the dates or create dates. The back end database is a SQL Server and I like to know what is the logical way...
3
by: laredotornado | last post by:
Hi, I have two columns, both MySQL 4 DATETIME types ... TABLE1.depart_day TABLE2.depart_day and both are indexed. The problem is, all of TABLE1's dates have a time of midnight (e.g....
7
by: JJ | last post by:
How do I set one field to have the updated timestamp, and another to have the created timestamp? I want to do this directly from code generated from DB Designer if possible?! JJ
1
by: ojorus | last post by:
Hi! A simple question maybe... I have a datetime column in a table, and want to automaticly insert local (Norwegian) time into the column. (I use PHP 5) I can not use NOW() since the mysql...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.