Solved

#Error in query field

Posted on 2014-12-22
3
141 Views
Last Modified: 2014-12-22
I have a field in a query that is returning #Error.

The syntax I have for the field in the query designer is:  ConvertedSchedHrs: CDbl([SchedHrs])*24

The field SchedHrs syntax is SchedHrs: [LoadSchComplete]-[LoadSchStart]  and is a shorttime field.

LoadSchComplete and LoadSchStart have no format in the query but in the table they both are both Date/Time fields.

How can I get rid of the #Error result which is ultimately showing up on a report field also?
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 40512910
try using the Nz() function here

SchedHrs:Nz([LoadSchComplete],0)-Nz([LoadSchStart],0)
0
 
LVL 7

Expert Comment

by:Robert Sherman
ID: 40512914
Is the error in the "ConvertedSchedHrs" column or the "SchedHrs" column?
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40513053
What happened to using:

Format([LoadSchComplete]-[LoadSchStart], "hh:nn")

Personally, if you don't want to use that option, I would have used:

ConvertedSchedHours: IIF(IsNull([LoadSchComplete]), NULL, IIF(IsNull([LoadSchStart]), NULL, [LoadSchComplete] - [LoadSchStart])) * 24

This would return a NULL if either the Complete or Start field is NULL
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question