Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 16th, 2004, 02:33 PM
Registered User
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query yes/no data type

I am developing a database which has a yes/no data type field in it.
A sample of the table is below:

Customer Name - text
Customer Still Active - yes/no data type

I need to develop a query which creates 2 seperate tables from the master table which are based on whether a customer is still active or not.
However, i am having problems creating a query in which the main field of query is the yes/no data type. I've had a host of erros - any help in this area would be more than welcome.

thank you
  #2 (permalink)  
Old June 16th, 2004, 04:55 PM
Authorized User
 
Join Date: May 2004
Location: , NH, USA.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The Yes/No type field is a boolean type. And the True value of booleans in Access is "-1", not "1" as in many other languages.

Need something like:
If StillActive=-1 then append to table1
Else
If StillActive=0 then append to table2
Else
Do Nothing, must be a null value.
======================================
Could do 2 separate MakeTable queries:
1. Select all where StillActive = -1
2. Select all where StillActive = 0

Sanity Check: Total Records in Table1 and Table2 = Total Rercords in original table. Any difference in count = Null values in StillActive.
=======================================
  #3 (permalink)  
Old June 16th, 2004, 06:18 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oxford, , United Kingdom.
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...which is why you should you the intrinsic constants TRUE and FALSE whenever you wish to do tests of this nature.


Brian Skelton
Braxis Computer Services Ltd.
  #4 (permalink)  
Old June 18th, 2004, 03:05 PM
Registered User
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Would like to thank you both for your useful comments, i have now got the query working using your guidelines.

Much appreciated,

Andrew


Similar Threads
Thread Thread Starter Forum Replies Last Post
data type kfir XML 6 May 7th, 2006 07:15 AM
Query on the wrong data type ggiibboo VB Databases Basics 1 January 31st, 2006 07:44 PM
Which data type should I use? logmaster C# 0 January 2nd, 2006 10:06 AM
Changing data type JLN Pro VB 6 1 July 13th, 2004 12:49 PM
Data Type error but it is the correct type Mitch SQL Server 2000 2 March 19th, 2004 11:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.