Ray, Here is my two cents - probably not even worth that, but its not a programmatic way to accomplish what you want, but if you have MS Access I would open the table once it is created and go to design view and set the default value for the column from its list of properties.
Best of Luck. Mike Sumner Nations Best Sports -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ray Hughes Sent: Wednesday, July 05, 2006 2:19 PM To: [email protected] Subject: [DFW CFUG] MS Access Syntax problem Hi All, I am trying to create a table and default the two integer fields to zero. What is the proper syntax for a MS access database table? The following creates the table but with null values in the fields of Q00Flag, and Q01. CREATE TABLE CAT01 ( CAT01id AUTOINCREMENT, Carnumber varchar(25), DateCreated datetime, Q00Flag integer not null , Q01 integer not null , Q01Date datetime ) I want to create this table such that these fields are created with a default value of zero. Also such that when records are inserted into the table, then that these fields are automatically set to zero if not otherwise specified by values in the insert statement. These do not work. Q01 integer set default '0', Q01 integer not null default '0', Could someone help me? PS I am using WINSQL as the db tool. Regards _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ Reply to DFWCFUG: [email protected] Subscribe/Unsubscribe: http://lists1.safesecureweb.com/mailman/listinfo/list List Archives: http://www.mail-archive.com/list%40list.dfwcfug.org/ http://www.mail-archive.com/list%40dfwcfug.org/ DFWCFUG Sponsors: www.HostMySite.com www.teksystems.com/ _______________________________________________ Reply to DFWCFUG: [email protected] Subscribe/Unsubscribe: http://lists1.safesecureweb.com/mailman/listinfo/list List Archives: http://www.mail-archive.com/list%40list.dfwcfug.org/ http://www.mail-archive.com/list%40dfwcfug.org/ DFWCFUG Sponsors: www.HostMySite.com www.teksystems.com/
