A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Recording the frequency of Yes/No Fields



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old October 24th, 2009, 01:38 AM posted to microsoft.public.access.tablesdbdesign
David W. Fenton
external usenet poster
 
Posts: 3,373
Default Recording the frequency of Yes/No Fields

"Allen Browne" wrote in
:

If the answer was No, presumably the Number is zero. It seems to
me that this would be a better (more reliable) design, as it would
prevent the existence of bad data (e.g. where the Yes/No field
contains No, but the Number field contains 8.) Having just the
Number field avoids that kind of inaccuracy.


The other nice thing about that is you don't lose the Boolean test.
Instead of testing Yes/No field = True, you'd test Count 0, or,
for that matter, Count Not False. Of course you'd want to have the
default value of the Count field by 0, but if you needed to know it
hadn't been filled out (such that you didn't want the default value
to be 0), you could test ((Not IsNull(Count)) AND (Count False)).
This will work because (False And Null) returns False, so if you
want Null or 0 to return False it would work.

(Not IsNull(Null)) AND (Null False) = False (False And Null)

(Not IsNull(0)) AND (0 False) = False (False And False)

(Not IsNull(1)) AND (1 False) = True (True And True)

All other numbers behave the same as 1, of course.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.