Database Reference
In-Depth Information
TIP
You don't even have to write the second formula in place of the words “Calculated Discount.” Until
you click OK, you can treat the calculation box like a big word processing page. Move the insertion
point a few lines past the first calc and then create the second calc. Then when it's correct, cut and
paste it into place in the first calc.
The entire Max() function, complete with its two parameters, is now the Min() function's
first parameter. You might think it looks a little confusing at first, but with practice you be-
come accustomed to looking at functions-inside-functions like this.
If it helps, you can add white space and comments to clarify the calculation, as Figure 10-2
shows.
If you want to test a complicated calculation, then spot-check a few records where you know
the result. Sometimes the math is so complex that you just have to work it out on paper and
enter dummy records to check the calculation. Usually, if a calculation isn't working, you
can figure out how to fix it when you compare your math to the value in the field.
Figure 10-2. You may find it hard to write nested calculations, and hard to read them if you need to
come back later and tweak them. In this case, though, the calculation is formatted with copious
white space and plenty of comments. Chances are you understand this version better than the one
shown in the text above.
Text Calculations
Although most people think of functions for doing dry stuff like math in a spreadsheet, you
can also use functions in your database's text fields. Just as you can add and subtract num-
bers with number functions, you can use text functions to slice and dice the words in your
database. For example, you might receive data from an outside source that needs major
Search WWH ::




Custom Search