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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

yes/no fields 1

Status
Not open for further replies.

thumbelina

Programmer
Jun 4, 2001
58
CA
does anyone on know how how to create a yes/no field in a table? in access it appears as a check box. I've thought of putting in a varchar(1) field, but then people would be able to enter other letters, unless there is a way to limit what letters can be entered in the field. If anyone has any ideas let me know.
 
Use column type ENUM. Example:

ALTER TABLE users ADD freetrial ENUM ('Yes','No') not null;

This would limit the possible entries in the field to "Yes" or "No". This is case-sensitive, you can't use "yes" or "no" unless you include them in the ENUM definition. An ENUM field can have up to 65535 different choices.

See and
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top