473,480 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Query Question

6 New Member
I have an existing database with one field with financial figures ($00,000).
How do I setup a query where I can find those fields where there are either no entries (null)? or $0.00 dollar entries?

I realize its an OR operator within that particular column but how are the figures expressed?

Thanks.
Nov 2 '06 #1
2 990
VALIS
21 New Member
I have an existing database with one field with financial figures ($00,000).
How do I setup a query where I can find those fields where there are either no entries (null)? or $0.00 dollar entries?

I realize its an OR operator within that particular column but how are the figures expressed?

Thanks.
Try typing a version of the following in the SQL view of the query.
You need to substitute your table name and field name for tbl & Field.

SELECT tbl.*
FROM tbl
WHERE (((tbl.Field) Is Null)) OR (((tbl.Field)="0"));
Nov 2 '06 #2
NeoPa
32,556 Recognized Expert Moderator MVP
Another good answer Valis, but you may come unstuck on the test for zero.
This depends heavily on what type of field 'Field' is.
I'm going to assume that the field is a simple numeric field and then I can forget about formatting.
If it's actually a string (formatted currency value for instance) then I would suggest converting the result to a numeric as CDbl([Field]). This avoids any hiccoughs with data entry or confusion over the exact format (it's also more reuseable code).
Also, I will use the Nz() function to avoid having to use 'OR' and to do it in one test.
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM tbl
  3. WHERE (Nz([Field], 0) = 0);
or, for the string version
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM tbl
  3. WHERE (Nz(CDbl([Field]), 0) = 0);
Nov 2 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
3395
by: majsen | last post by:
Hi, I have problem running this query. It will time out for me... My database are small just about 200 members. I have a site for swaping appartments (rental). my query should look for match in...
8
3220
by: Együd Csaba | last post by:
Hi All, how can I improve the query performance in the following situation: I have a big (4.5+ million rows) table. One query takes approx. 9 sec to finish resulting ~10000 rows. But if I run...
3
14109
by: John Ortt | last post by:
> I have a table of dates in ascending order but with varying intervals. I > would like to create a query to pull out the date (in field 1) and then pull > the date from the subsequent record...
3
3052
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
7
3366
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
6
4810
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
2
2026
by: mmitchell_houston | last post by:
I'm working on a .NET project and I need a single query to return a result set from three related tables in Access 2003, and I'm having trouble getting the results I want. The details: ...
22
31143
by: Stan | last post by:
I am working with Access 2003 on a computer running XP. I am new at using Access. I have a Db with a date field stored as mm/dd/yyyy. I need a Query that will prompt for the month, ie. 6 for...
3
2053
by: Richard Hollenbeck | last post by:
I am very sorry about the (almost) re-post, but you will see that my first question wasn't very clear; I have another question I posted this morning called, "in DAO: Run time error 3061 Too few...
16
3459
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
0
7048
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6911
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7050
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6966
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
2999
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.