How to calculate with NULL-Values?

  • Thread starter Thread starter nieurig
  • Start date Start date
N

nieurig

Hello forum,
i need to calculate with fields
with have probably the value NULL
like this:

SELECT Time * Faktor_Spez
* Faktor_Allg as TotalTime
FROM ....

Using this i get error-values instead
of the calucated result. Faktor_Spez and
Faktor_Allg are fields from other tables
witch are linked by OUTER JOIN to the main table.

At SQL-Server i could solve this
problem by using the ISNULL() function.

SELECT Time * ISNULL(Faktor_Spez,0)
* ISNULL(Faktor_Allg,0) as TotalTime
FROM ....

Did someone knows a solution for ACCESS (97)?

Thanks a lot for your help.
Niels
 
Niels,

Use the Nz() function (null to zero) inthe same way you used ISNULL,
i.e...
SELECT Time * Nz(Faktor_Spez,0) * Nz(Faktor_Allg,0) AS TotalTime

- Steve Schapel, Microsoft Access MVP
 
Back
Top