Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 11th, 2002, 11:04 AM
Beans4You's Avatar
Beans4You Beans4You is offline
Some day I will be a Lambda!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: NJ
Posts: 18 Beans4You User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question 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

Reply With Quote
  #2  
Old December 11th, 2002, 11:12 AM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,172 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 29
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?

Reply With Quote
  #3  
Old December 11th, 2002, 11:50 AM
Beans4You's Avatar
Beans4You Beans4You is offline
Some day I will be a Lambda!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: NJ
Posts: 18 Beans4You User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #4  
Old December 11th, 2002, 11:55 AM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,172 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 29
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.

Reply With Quote
  #5  
Old December 11th, 2002, 12:03 PM
Beans4You's Avatar
Beans4You Beans4You is offline
Some day I will be a Lambda!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: NJ
Posts: 18 Beans4You User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #6  
Old December 11th, 2002, 12:08 PM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,172 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 29
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.

Reply With Quote
  #7  
Old December 11th, 2002, 12:23 PM
Beans4You's Avatar
Beans4You Beans4You is offline
Some day I will be a Lambda!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: NJ
Posts: 18 Beans4You User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks.

Then I'll just run with it as an integer type.

Eric

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Boolean Data Type Help

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap