How to calculate with NULL-Values?

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
 
S

Steve Schapel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top