Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL changing Access Yes/No field

Status
Not open for further replies.

tdion

MIS
Dec 18, 2003
61
US
How do you do an SQL Insert command to change a Yes/No field?

For example,
INSERT INTO TABLE (field) VALUES (-1)

INSERT INTO TABLE (field) VALUES (True)

INSERT INTO TABLE (field) VALUES ('-1')

I am getting an SQL exception for every way I've tried so far. Someone help!
 
This format should work if it is an Access database.
INSERT INTO TABLE (field) VALUES (-1)
 
You can use True/False also ... might make it easier for you to understand your own code.

INSERT INTO TABLE (field) VALUES (True)
INSERT INTO TABLE (field) VALUES (False)

If you're not a hardcore programmer, I think it's easier to understand that than:

INSERT INTO TABLE (field) VALUES (-1)
INSERT INTO TABLE (field) VALUES (0)

but that's just my humble 1.7 cents worth ...


Greg Tammi, IT Design & Consultation
Work: Home:
 
You cannot use "TABLE" as a table name - it is a reserved word. Try a different name.
 
You are too technical Jonfer.

I used TABLE to make things easier to understand.

Thanks for your help though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top