Retrieving records where yes/no data type is checked

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

One of the fields in my query where some records are checked and some are
not. Without setting any criteria in the criteria row, all records are shown
in the result set. What do I need to write in the criteria row so the result
set will show only the items checked? Example: the sale column is a yes/no
data type. I want to show only records with actual sales, not all the
records for the fields to be displayed inthe result set.

What is the expression to use where "sale" is not null?
 
If I understand correctly, Yes/True = -1 and No/False = 0. To show only
records where a yes/no field is checked/yes/true, set the criteria to -1.
 
Please tell me exactly what to write in that row. I do not want the result
set to contain every record in the group, only the ones with sales--where
sale is checked. The errors I keep getting are "Data type mismatch in
criteria expression" and "The syntax of the subquery in this expression is
incorrect."
 
Thank you for your response. I tried putting just a "-1" in the criteria row
for sale and it worked. The result set listed only the sales. Sorry I did
not get back to you sooner but I was busy all day.

Now, I have another problem. The first column in the result set is called
"store" where the various names for the stores are listed. What do I write
in the criteria field for this column to select a certain store and get the
result set to contain all the sales for that particular store? Thank you
again.
 
Thank you. I will have to read this carefully.

One more question. To learn how to write better queries, would you suggest
learning Visual Basic or SQL server?
 
Queries don't require knowing either Visual Basic (a programming language)
or SQL Server (a database server). You should check out some resources on
SQL. John Viescas has some book links at
http://www.viescas.com/Info/books.htm. Check out the books authored by him
and Michael Hernandez.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top