Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Derivatives in Access 1

Status
Not open for further replies.

WalterContrata

Technical User
May 27, 2005
79
US
What is a good method of calculating derivatives in Access (or of calculating anything that depends on multiple rows of a table.)?

I have a table of phase ([φ]) versus frequency (f), and I need to calculate d[φ]/df, the group delay.

Here is a sample:

ID f [φ]
11 3.045 -1.35
12 3.344 -1.52
13 3.644 -1.67
14 3.943 -1.82
15 4.243 -1.98
16 4.542 -2.13
17 4.842 -2.32
18 5.141 -2.5
19 5.441 -2.66

I need to calculate

([φ][sub]ID+1[/sub] - [φ][sub]ID-1[/sub])/(f[sub]ID+1[/sub] - f[sub]ID-1[/sub])

Can it be done with a query? Is VBA the best, or only, way?

Best Regards,
 
A starting point:
SELECT B.ID, B.f, B.?, (C.?-A.?)/(C.f-A.f) As Delay
FROM (yourTable B
INNER JOIN yourTable A ON B.ID = A.ID + 1)
INNER JOIN yourTable C ON B.ID = C.ID - 1

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top