Add fields with null value

  • Thread starter Thread starter renold1958
  • Start date Start date
R

renold1958

Have a query with 2 fields.
1. Price
2. GST

Now I need to create a field wich adds both of them up.

TotalCost:[price]+[gst]

All works fine, except when there is no value in the GST
field for a record, so the TotalCost for that record adds
up to null aswell.

Forgot what to put before [gst], when there is no value in
that field, but it still gives me a TotalCost value.

Thanks
 
Nz() allows you to specify a value to use for null, e.g.:
TotalCost: CCur(Nz([price], 0) + Nz([gst],0))

A better idea would be to store the GstRate for each record, rather than the
GST amount. This avoids the dependency between the Price and GST fields.
 

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

Back
Top