Stuart McLachlan
stuart at lexacorp.com.pg
Wed May 14 17:43:13 CDT 2003
On 14 May 2003 at 8:30, Henry Simpson wrote: > 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. > It's for speed/simplicity versus storage requirements. A 32 bit (long) data type is the quickest and easiest to retrieve/mainipuate/store in a 32 bit OS. If you used a single bit to store a yes/no field, it would reduce the storage requirement, but think about how you would then have to store/locate/ index etc that particualr bit. It would make it a very slow datatype to use in comparison. If you only have a single Yes/No field in the table, what are you going to do with the other 7 bits in the byte anyway - so you might as well just store it as a whole byte. Once you take that step, you might as well use a long for speed rather than a byte (You don't use single byte Integer variables do you <g>) -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support.