...

View Full Version : update statment using checkboxes



Keltoi
11-25-2003, 02:08 PM
Hi All,
I have a query that has been perplexing me for a while.
When I write an update command, in the SQL I encase the runtime variable for
a text field in inverted commas ('), date with (#)... But how do you update
checkboxes?

EG:
UPDATE textField = 'varText', numberField = varNumber Where (what ever) But what about checkbox (yes/no) fields?

Please can someone enlighten me?

TIA
Justin

Keltoi
11-25-2003, 03:39 PM
I've found the solution for those who wish to know:

In Access you would use 0 for false and -1 for true.
In SQL Server you would use 0 for false and 1 for true.

yokelrobin
11-25-2003, 03:41 PM
I normally don't even bother using checkboxes - just have a number field where I enter 0 for false and 1 for true.

Probably not the proper way to do it, but it does make things easy :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum