If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
how do you create an auto number field in Access using DDL?
how do you create an auto number field in Access using DDL? the Auto things
it an Auto..! |
#2
|
|||
|
|||
"KhalilS" wrote in message ... how do you create an auto number field in Access using DDL? the Auto things it an Auto..! Example: CREATE TABLE Policies (policy_id AUTOINCREMENT ,policy_start_date DATETIME ,policy_renewal_date DATETIME ,premium_payable CURRENCY ,other_policy_details TEXT(255) ,CONSTRAINT pk_Policies PRIMARY KEY (policy_id) ) Sincerely, Chris O. |
#3
|
|||
|
|||
Chris2 wrote: CREATE TABLE Policies (policy_id AUTOINCREMENT ,policy_start_date DATETIME ,policy_renewal_date DATETIME ,premium_payable CURRENCY ,other_policy_details TEXT(255) ,CONSTRAINT pk_Policies PRIMARY KEY (policy_id) ) FWIW I prefer the synonym IDENTITY i.e. the same for SQL Server. Also, you can explicitly specify the data type plus the seed and increment values e.g. could make your column definition clearer with: policy_id INTEGER IDENTITY (1,1) NOT NULL Jamie. -- |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I number and rank records in Access, based on another field | Heather | New Users | 1 | February 24th, 2005 03:42 AM |
incorrect sums in report using 2 tables | jkendrick75 | Setting Up & Running Reports | 22 | December 13th, 2004 03:19 PM |
Access: How can I generate an auto number for each record in a ta. | TerryGB | Running & Setting Up Queries | 1 | November 2nd, 2004 01:38 PM |
Images in a database | Franz | General Discussion | 10 | October 7th, 2004 09:35 AM |
Auto Number part of a field | MDW | Running & Setting Up Queries | 1 | October 1st, 2004 12:13 PM |