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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Error Count



 
 
Thread Tools Display Modes
  #1  
Old February 11th, 2009, 10:05 PM posted to microsoft.public.access.reports
JT
external usenet poster
 
Posts: 223
Default #Error Count

I have a query which converts a date format from YYYYMMDD to MM/DD/YYYY.
When there is no date, the query returns a blank. When I use this query in
my report, the report field returns "#Error" when the date is blank. I
understand why, but what I want to do is to count the number of #Error
occurrences. I have tried =SUM(IIF([NEED] ="#Error#",1,0)) and
=SUM(IIF([NEED_DATE] 0,1,0)) and neither work. Any ideas?? (Note that
NEED is the formatted version of NEED_DATE)
  #2  
Old February 12th, 2009, 06:44 AM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default #Error Count

You can count the number of Null/empty values in a report or group section
with a control source of:
=Sum(Abs(IsNull([FieldName])))

--
Duane Hookom
Microsoft Access MVP


"JT" wrote:

I have a query which converts a date format from YYYYMMDD to MM/DD/YYYY.
When there is no date, the query returns a blank. When I use this query in
my report, the report field returns "#Error" when the date is blank. I
understand why, but what I want to do is to count the number of #Error
occurrences. I have tried =SUM(IIF([NEED] ="#Error#",1,0)) and
=SUM(IIF([NEED_DATE] 0,1,0)) and neither work. Any ideas?? (Note that
NEED is the formatted version of NEED_DATE)

  #3  
Old February 13th, 2009, 03:03 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 2,364
Default #Error Count

Fix it so that your query handles the conversion properly.

Perhaps using an expression like the following to convert the field to
date or to a null value if the field cannot be properly converted.

IIF(IsDate(Format([NEED],"@@@@-@@-@@")),CDate(Format([NEED],"@@@@-@@-@@")),Null)

Now you can count the nulls in your report if that is needed, by using a
control with this expression as the source

= Abs(Sum([Need] is Null))

'================================================= ===
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'================================================= ===


JT wrote:
I have a query which converts a date format from YYYYMMDD to MM/DD/YYYY.
When there is no date, the query returns a blank. When I use this query in
my report, the report field returns "#Error" when the date is blank. I
understand why, but what I want to do is to count the number of #Error
occurrences. I have tried =SUM(IIF([NEED] ="#Error#",1,0)) and
=SUM(IIF([NEED_DATE] 0,1,0)) and neither work. Any ideas?? (Note that
NEED is the formatted version of NEED_DATE)

 




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 07:35 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.