The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Databases
> Database Management
|
Boolean Data Type Help
Discuss Boolean Data Type Help in the Database Management forum on Dev Shed. Boolean Data Type Help Database Management forum discussing non-database specific SQL. Structured Query Language was designed to be a robust and standardized language for manipulating relational databases.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 11th, 2002, 11:04 AM
|
 |
Some day I will be a Lambda!
|
|
Join Date: Jun 2002
Location: NJ
Posts: 18
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Boolean Data Type Help
Is there any way to create a field with variable Yes/No or Boolean type? I'm creating Access tables on the fly which contain the same structure as someone else's tables, at his request. The problem is is that he has this Yes/No data type field.
Any help would be appreciated.
Thanks
Eric
|

December 11th, 2002, 11:12 AM
|
 |
Big Endian
|
|
Join Date: May 2001
Location: Fly-over country
|
|
|
Setting a boolean field to Yes/No or True/False in Access is simply a matter of setting a property for that field. When you create the table there's a property box at the bottom of the form that allows you to set properties for each field. That is where you would set it to Yes/No. I'm sure there's a way to do it programatically as well.
Is this what you're asking?
|

December 11th, 2002, 11:50 AM
|
 |
Some day I will be a Lambda!
|
|
Join Date: Jun 2002
Location: NJ
Posts: 18
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Yes, I know that you can set it from within the Access GUI, but I'm trying to accomplish it pragmatically. I have done several searches on Google and different forums and I cannot find any data types for Boolean.
I did find this website which seems to give an example but I still get an unfriendly error message.
Website
Code:
CREATE TABLE RentalUnits (
UnitId Counter,
Address char(30),
Occupied Boolean DEFAULT F,
PaymentDue Date DEFAULT CURRENT DATE
)
Eric
|

December 11th, 2002, 11:55 AM
|
 |
Big Endian
|
|
Join Date: May 2001
Location: Fly-over country
|
|
|
If you're not using the GUI, then why does it matter if the field is Yes/No, True/False or 1/0? That setting is for display purposes like the formatting of a date field. Internally, they're all stored the same way.
|

December 11th, 2002, 12:03 PM
|
 |
Some day I will be a Lambda!
|
|
Join Date: Jun 2002
Location: NJ
Posts: 18
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I'm sending data to this colleague who asked for me to replicate and fill some tables that he sent me. I would think that an integer data type would be fine, but I cannot contact him at the moment. Therefore, I thought that I would see if I could find a way to store it as a Boolean.
|

December 11th, 2002, 12:08 PM
|
 |
Big Endian
|
|
Join Date: May 2001
Location: Fly-over country
|
|
|
What I was trying to say in my previous post was if you are using a boolean data type then storing a 0, NO or FALSE in the field is all equal to the same thing. Setting the YES/NO field is not important to how the data is stored, it just affects the way the data is displayed visually.
In other words, it doesn't matter how you store or replicate the boolean values. The person you are sending them to can view them in any format he likes.
|

December 11th, 2002, 12:23 PM
|
 |
Some day I will be a Lambda!
|
|
Join Date: Jun 2002
Location: NJ
Posts: 18
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Thanks.
Then I'll just run with it as an integer type.
Eric
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|