Math in Access?

G

Gary Hull

I am working on an estimation program for commercial millwork. It will
require a lot of math calculations. What is the best way to do this in
access?

Thanks
 
S

Stefan Hoffmann

hi Gary,

Gary said:
I am working on an estimation program for commercial millwork. It will
require a lot of math calculations. What is the best way to do this in
access?
This really depends on your skills and the type of calculations.

With an appropriate database schema you can do a lot of calculations in
queries (SQL), e.g. aggregates, simple statistics, simple caluclations
(+-*/).

More complex calculations, e.g. interpolation or regression
calculations, are better encapsuled in VBA functions:

Public Function LinInter(ByVal x As Double, ByVal x1 As Double, _
ByVal x2 As Double, ByVal y1 As Double, _
ByVal y2 As Double) As Double

On Local Error GoTo LocalError

LinInter= ((x2 - x) * y1 + (x - x1) * y2) / (x2 - x1)

Exit Function

LocalError:
If (x = x1) And (x = x2) And (y1 = y2) Then
LinInter= y1
Else
LinInter= -1 'or any other magic number
End If

End Function


mfG
--> stefan <--
 

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

Top