ALTER TABLE xx ADD coly ‘Check box’??

N

Nevie and Phil

ALTER TABLE xx ADD coly ‘Check box’??

How do I use the alter SQL to add a yes/no (true/false) field in a table?
Is there a better way to do this?


Thanks!
 
M

Marshall Barton

Nevie said:
ALTER TABLE xx ADD coly ‘Check box’??

How do I use the alter SQL to add a yes/no (true/false) field in a table?
Is there a better way to do this?


Well, there are lot's of way to manipulate table/fields, but
I think Executing an SQL DDL statement is the easiest to
code and to understand. Others may have their own opinion.

Depending on what else you may have going on in your
procedure, it could be as straightforward as:

CurrentDb.Execute "ALTER TABLE xx ADD COLUMN coly YESNO"
 
N

Nevie and Phil

That did it! Thanks man.

Sometimes I’m embarrassed to ask these kinds of things, but I really
appreciate the help! I was trying yes/no, true , false, Boolean..

Thanks again!
 
M

Marshall Barton

BOOLEAN, LOGICAL and BIT should be acceptable synonyms for
YESNO, so, AFAIK, Boolean should have worked.
 
N

Nevie and Phil

Logical, and Bit worked, but Boolean gave me an error. But now I know. This
is pretty cool, where did you learn this?

But give it a try, I'm using MS Access 2002. That might be why boolean
isn't working for me.

Marshall Barton said:
BOOLEAN, LOGICAL and BIT should be acceptable synonyms for
YESNO, so, AFAIK, Boolean should have worked.
--
Marsh
MVP [MS Access]

That did it! Thanks man.

Sometimes I’m embarrassed to ask these kinds of things, but I really
appreciate the help! I was trying yes/no, true , false, Boolean..

Thanks again!
 
M

Marshall Barton

Interesting! I could swear that Boolean used to work in
some(?) version of Access, but, you're right, it doesn't
work in AXP.

Just goes to show how much you can trust the Help files :-(
Contents, Jet SQL reference, Data Definition Language.

You ask where I learned this stuff? By reading the Help
files, a lot of trial and error and hanging out in these
newsgroups.
--
Marsh
MVP [MS Access]


Logical, and Bit worked, but Boolean gave me an error. But now I know. This
is pretty cool, where did you learn this?

But give it a try, I'm using MS Access 2002. That might be why boolean
isn't working for me.
 
Top