Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 28th, 2003, 09:16 AM
Registered User
 
Join Date: Jul 2003
Location: Cape Town, , South Africa.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Alter Table - Add Column

Hi
Can anyone help. I am trying to use the 'Alter Table' statement to add a column to a table. The column I need to add is a Yes/No data type:

ALTER TABLE TargetSelect ADD COLUMN TransSelect Yes/No

Access doesn't seem to accept the data type 'Yes/No' so I just get a syntax error. Any suggestions?
Thanks
Liz


  #2 (permalink)  
Old July 28th, 2003, 11:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Use the ANSI SQL data type BIT as in:

ALTER TABLE TargetSelect ADD COLUMN TransSelect BIT

(Yes/No is the Access SQL synonym for the ANSI SQL data type).

Bob
  #3 (permalink)  
Old July 29th, 2003, 03:06 AM
Registered User
 
Join Date: Jul 2003
Location: Cape Town, , South Africa.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Bob
Thanks for your response. It worked well.
Regards
Liz




Similar Threads
Thread Thread Starter Forum Replies Last Post
alter add puzzle: Invalid column name JL1024 SQL Server 2000 11 June 11th, 2013 04:59 PM
Alter Column SQLScott SQL Server 2005 5 January 5th, 2007 11:53 AM
Alter a column as identity for table kasanar SQL Server 2000 5 July 6th, 2005 08:44 AM
Access SQL alter table add constraint Skipmeok SQL Language 0 April 27th, 2004 08:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.