Henry Simpson
hsimpson88 at hotmail.com
Wed May 14 12:49:29 CDT 2003
Implying that a boolean field is a signed byte, and that could be why there are two bytes. Form and code logic, bound or otherwise only require zero or not zero. If I'm not mistaken, .Net is 0 and 1, or at least there were rumblings that this was going to be the case earlier in the .Net design process. Maybe someone who knows can chime in. I won't second guess Microsoft on why they went to a two byte field, I simply use a byte and occasionally, bits of the byte. I see no reason for the datatype except that it displays a checkbox in the table, and my users don't see tables. If Microsoft uses a signed byte for backward compatibility with VB and VBA, they could have used the first bit and made the numeric range -128 to 127 and kept it at a byte. Signed and unsigned typically cover the same range of numbers execpt it starts at negative 1/2 the value of the unsigned numeric. Whatever their reasons, they seem illogical and inconsistent. Hen >From: "Charlotte Foust" <cfoust at infostatsystems.com> >Reply-To: accessd at databaseadvisors.com >To: <accessd at databaseadvisors.com> >Subject: RE: [AccessD] Very interesting quirk in table design... >Date: Wed, 14 May 2003 09:08:44 -0700 > >:oP > >That would be -1 as opposed to 1. > >Charlotte Foust > >-----Original Message----- >From: Gustav Brock [mailto:gustav at cactus.dk] >Sent: Wednesday, May 14, 2003 7:49 AM >To: accessd at databaseadvisors.com >Subject: Re: [AccessD] Very interesting quirk in table design... > > >Hi Charlotte > >Would that be for Not Yes and Not No? > >(sorry) > >/gustav > > > > Is the additional byte for the sign? > > > Charlotte Foust > > > -----Original Message----- > > From: Henry Simpson [mailto:hsimpson88 at hotmail.com] > > Sent: Wednesday, May 14, 2003 6:30 AM > > To: accessd at databaseadvisors.com > > Subject: Re: [AccessD] Very interesting quirk in table design... > > > > Curious that in Access 97, and I'll assume subsequent versions as >well, > > a yes/no field stores 2 bytes for each entry. Using a numeric value > > like a byte requires half the storage and gives you 8 states that > > equate to 8 two state fields or 4 four state fields or whatever > > other combination of 8 bits you devise, plus null. I've never > > understood why the yes/no field requires two bytes and use bytes for > > boolean fields for the increased flexibility. > > Form logic doesn't seem to require any change if you simply use one >byte > > field for each field requiring a boolean display. _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail