Why would this query give #Error values

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

Guest

Hello ....

I am running the following query:

SELECT a.Area, a.Day, Nz(b.DayTime,0) AS DayHours
FROM AllDates AS a LEFT JOIN DayTimeHours AS b ON (a.Area = b.Area) AND
(a.Day = b.Day)
ORDER BY a.Area, a.Day;

The majority of records are fine, but those records in AllDates where there
are no corresponding records in DayTimeHours getting a #Error instead of a 0
in the DayHours column. Is it the "a.Day=b.Day" that is causing problems, or
else might I have I gone wrong?

Thanks.
 
May be a problem with a data type mismatch from the Nz function. What is the
data type of the DayTime field in the DayTimeHours table?
 
The DayTime field is part of a query and comes from an End (Date/Time format)
- Start (Date/Time format) calculation.
 
Back
Top