Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date not Null from MySQL

Status
Not open for further replies.

perrymans

IS-IT--Management
Nov 27, 2001
1,340
US
I am using Access as te front-end for a MySQL database.

One of the queries was based on a Date field being Null. But it looks as though MySQL puts 00/00/00 in every field, hence it is not null.

I do have the default value set to null in the tables.

Is this normal?

Thanks. Sean.
 
i'm using 4.0.16 and it allows null date fields nicely
Code:
create table testnulldates
( id tinyint not null primary key auto_increment
, foo date null
, bar date not null
, qux date not null default '1999-12-31'
);
insert into testnulldates (foo,bar,qux) 
values ( null, current_date , current_date )
;
insert into testnulldates (foo,bar) 
values ( null, current_date  )
;
select * from testnulldates;



rudy | r937.com | Ask the Expert | Premium SQL Articles
SQL for Database-Driven Web Sites (next course starts May 8 2005)
 
It is also doing it to me on some of the number fields too where it puts 0 as the default, and I can't seem to erase it (using phpmyadmin).

Sean.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top