Math in Access?

  • Thread starter Thread starter Gary Hull
  • Start date Start date
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
 
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 <--
 
Back
Top