Yeh your right Bob....I suggested he used GETDATE() 'cos I didn't realise he
was using Access (I should read my mails properly!!)

I've had a quick look around but I can't see anywhere in the Access
documentation that tells you how to set a default for a filed!  You must be
able to do it as you can using the table design wizard.  It's a pain in the
butt that when you do use the table design wizard you can't view the SQL
that Access writes for you as you can when you use the query design wizard.

------------------------------------------------------------------ 
Andrew Ewings
Project Manager
Thoughtbubble Ltd 
http://www.thoughtbubble.net 
------------------------------------------------------------------ 
United Kingdom 
http://www.thoughtbubble.co.uk/ 
Tel: +44 (0) 20 7387 8890 
------------------------------------------------------------------ 
New Zealand 
http://www.thoughtbubble.co.nz/ 
Tel: +64 (0) 9 419 4235 
------------------------------------------------------------------ 
The information in this email and in any attachments is confidential and
intended solely for the attention and use of the named addressee(s). Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Thoughtbubble. This information may be
subject to legal, professional or other privilege and further distribution
of it is strictly prohibited without our authority. If you are not the
intended recipient, you are not authorised to disclose, copy, distribute, or
retain this message. Please notify us on +44 (0)207 387 8890. 



-----Original Message-----
From: Bob Silverberg [mailto:[EMAIL PROTECTED]]
Sent: 03 November 2000 16:39
To: CF-Talk
Subject: RE: Create Table SQL


This is just a stab in the dark, but that SQL looks an awful lot like the
SQL you use in SQL Server.  Does it also work in Access (which Rich is
using) or is there an alternate syntax?

Bob

-----Original Message-----
From: ibtoad [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 03, 2000 9:55 AM
To: CF-Talk
Subject: RE: Create Table SQL


This isn't working for me and I can't figure out why.  This works:

auction_date   DATE     NOT NULL,

however as soon as I ad the Default part

auction_date   DATE     NOT NULL   DEFAULT GETDATE(),

I get errors.

Any Ideas,
Rich



-----Original Message-----
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 03, 2000 9:23 AM
To: CF-Talk
Subject: RE: Create Table SQL


To create a primary key create a unique clusted index after you have crated
the table like so....

CREATE TABLE <table name>
(       field1 int PRIMARY KEY CLUSTERED
,       field2 datetime DEFAULT GETDATE()
,       field3......
.
.
.
)

The other way is to creat the table and then create an unique clustered
index index afterwards to create the primary key and then perform an alter
table statement to set the default.

hope that helps

Andy


------------------------------------------------------------------
Andrew Ewings
Project Manager
Thoughtbubble Ltd
http://www.thoughtbubble.net
------------------------------------------------------------------
United Kingdom
http://www.thoughtbubble.co.uk/
Tel: +44 (0) 20 7387 8890
------------------------------------------------------------------
New Zealand
http://www.thoughtbubble.co.nz/
Tel: +64 (0) 9 419 4235
------------------------------------------------------------------
The information in this email and in any attachments is confidential and
intended solely for the attention and use of the named addressee(s). Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Thoughtbubble. This information may be
subject to legal, professional or other privilege and further distribution
of it is strictly prohibited without our authority. If you are not the
intended recipient, you are not authorised to disclose, copy, distribute, or
retain this message. Please notify us on +44 (0)207 387 8890.



-----Original Message-----
From: ibtoad [mailto:[EMAIL PROTECTED]]
Sent: 03 November 2000 14:13
To: CF-Talk
Subject: Create Table SQL


I have 2 questions, I am writting an CREATE Table SQL statement for MS
Access,

How do I create the table to have a primary key?

What statement do I use to create a date field with default Date()?

Thanks,
Rich

----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]

----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]

----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to