Jan 22, 2004 #1 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!
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!
Jan 22, 2004 #2 cmmrfrds Programmer Feb 13, 2000 4,690 US This format should work if it is an Access database. INSERT INTO TABLE (field) VALUES (-1) Upvote 0 Downvote
Jan 22, 2004 #3 grtammi Programmer Dec 22, 2001 477 CA 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: http://www.atsbell.comHome: http://members.shaw.ca/gregandliz Upvote 0 Downvote
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: http://www.atsbell.comHome: http://members.shaw.ca/gregandliz
Jan 22, 2004 #4 JonFer Programmer Nov 7, 2003 868 US You cannot use "TABLE" as a table name - it is a reserved word. Try a different name. Upvote 0 Downvote
Jan 23, 2004 Thread starter #5 tdion MIS Dec 18, 2003 61 US You are too technical Jonfer. I used TABLE to make things easier to understand. Thanks for your help though. Upvote 0 Downvote
You are too technical Jonfer. I used TABLE to make things easier to understand. Thanks for your help though.