Hi guys,
I'm not a newbie when it comes to MS Access, but I can't sort it out. Can you help me?
My report is based on a query that returns 0, 1, 2,... 10 or more records. The report displays all records (they are called batches) and below it displays their number (e.g. 5 records in total). I count the number of returned records using a field that value is "=COUNT (BATCH)". Everything works fine when there are 1, 2 or more batches. But when there is no batches the report displays "#Error" (or sth like that) instead of 0". How can COUNT function give an error instead of zero? What do I do wrong? I tried to experiment with Nz, but no luck. Anybody knows what I should do? Thank you for any help!
6 1266
Hi guys,
I'm not a newbie when it comes to MS Access, but I can't sort it out. Can you help me?
My report is based on a query that returns 0, 1, 2,... 10 or more records. The report displays all records (they are called batches) and below it displays their number (e.g. 5 records in total). I count the number of returned records using a field that value is "=COUNT (BATCH)". Everything works fine when there are 1, 2 or more batches. But when there is no batches the report displays "#Error" (or sth like that) instead of 0". How can COUNT function give an error instead of zero? What do I do wrong? I tried to experiment with Nz, but no luck. Anybody knows what I should do? Thank you for any help!
Try = Count(*)
This should give you a count of the records returned from your query, irrespective of whether or not a batch # has been assigned.
Try = Count(*)
This should give you a count of the records returned from your query, irrespective of whether or not a batch # has been assigned.
Thank you for your reply, but it still doesn't work.
I tried "=Count(*)" and I tried "=IIf(IsNull(Count(*)),0,Count(*))" and I tried "=Nz(Count(*), 0)" and it still gives me "#Error" when Batch Number is not assigned. I can't understand what the problem is!
Thank you for your reply, but it still doesn't work.
I tried "=Count(*)" and I tried "=IIf(IsNull(Count(*)),0,Count(*))" and I tried "=Nz(Count(*), 0)" and it still gives me "#Error" when Batch Number is not assigned. I can't understand what the problem is!
The only thing that I can think of is that the textbox where you are invoking the count function has a non-numeric format. Invoke the property sheet for the textbox check the format property. make sure that the format is numeric.
The only thing that I can think of is that the textbox where you are invoking the count function has a non-numeric format. Invoke the property sheet for the textbox check the format property. make sure that the format is numeric.
Thanks for your input again, puppydogbuddy. I have to admit that it didn't come to my mind. That textbox was created automatically by Report Wizard (or whatever it is called in MS Access), so I have no idea what format it is. I don't have MS Access at home, but I will check it as soon as I come back to work (which will happen on January 2).
But if the format is non-numeric, why does it work for numbers greater than zero?
Thanks for your input again, puppydogbuddy. I have to admit that it didn't come to my mind. That textbox was created automatically by Report Wizard (or whatever it is called in MS Access), so I have no idea what format it is. I don't have MS Access at home, but I will check it as soon as I come back to work (which will happen on January 2).
But if the format is non-numeric, why does it work for numbers greater than zero?
Oh, I did not know you were not getting #Error where Count was > 0. Then, there has to be something wrong with your nz syntax....your sample expressions were all enclosed in quotes...was that just for this writeup or are you using quotes in the textbox??? If you are, that is probably your problem.
Oh, I did not know you were not getting #Error where Count was > 0. Then, there has to be something wrong with your nz syntax....your sample expressions were all enclosed in quotes...was that just for this writeup or are you using quotes in the textbox??? If you are, that is probably your problem.
I'm not using quotes in the textbox, only in my posts.
As soon as I come back to work I will take a look at the text box and report properties, maybe something is hidden there and I didn't notice that?
What destroys me is that I waste my time for something so simple (but it's not the first time in MS Access).
Thanks for your help and Happy New Year! :-)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: deanfamily11 |
last post by:
When I run the following code through my compiler, I get C2065 and C2145
errors. Can someone help?
#include <iostream>
using namespace std;
int main ()
{
|
by: PST |
last post by:
Here's a problem I'm trying to deal with:
I'm working on a Frontpage 2000 website for a boat handicapping
system, built in Access 97.
What I'm trying to accomplish is:
The user enters a...
|
by: Andrew |
last post by:
Hi there:
I can successfully control a report's GroupLevel ControlSource property by
using:
..Reports!rptEESTMT_A.GroupLevel(i).ControlSource = "CorpName"
where rptEESTMT_A is the actual...
|
by: Drew |
last post by:
I have been using System.Text.Encoding.Unicode.GetString(byte,0,72)
to converter a byte array from the registry to a string.
This works, but I end up with a bunch of null characters after
the...
|
by: SWu |
last post by:
Hi all
Could someone please tell me how to configure and deploy my Crystal reports?
Any help would be greatly appreciated. I want to be able to deploy my
reports/web pages to another domain,...
|
by: Jim in Arizona |
last post by:
I'm going insane! I don't know if it's just that the .net 2.0 framework is
buggy or if it really is my code.
This is pretty hard to explain since I can't even begin to nail down why
this is...
|
by: sheltielover1 |
last post by:
Hello..
I was wondering if anyone out there could tell me how they deal with
NULL values in a data warehouse? I am looking to implement a warehouse
in SQL 2005 and have some fields which will...
|
by: Cliff72 |
last post by:
I need to fill in the nulls in the batch field the value from the
record immediately
preceding the null one ie replace the nulls with the preceding value
until I hit a record with a value in...
|
by: r_ahimsa_m |
last post by:
Hello,
I am learning JavaScipt. I have written some functions and I verified my
code using http://www.jslint.com/ validator. I don't understand the
problems it reports. Could you help me please...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |