(e-mail address removed) wrote...
the thing is that Access DOESNT have a 256 field limit-- it is only MDB
that has that limit. ADP against MDB (free SQL Server desktop engine,
available a half-dozen ways)
You don't get it. You say Access, but you mean Access and several other
products. Access *ALONE* is a toy, and this may come as news to you but
all employees in most large companies are *PROHIBITED* from installing
software on their own. So there may be a reasonable fraction of MSFT
Office users who have Access (I'd guess 25-30%), but almost none of
them have any of these other add-on products, and many (myself
included) work for companies that don't use SQL Server, so anything
associated with SQL Server would be prohibited even if the company were
willing to install other additional software.
So I'm make my statement more precise: Access *STANDALONE* has a 256
field per table limit.
Challenges:
- From months ago which you never fully answered: how would you
generate an amortization table in Access?
A SIMPLE CARTESIAN AND A COUPLE OF QUERIES.
You made this same mistake a few months ago.
A cartesian is a mistake since the resulting amortization table would
have 5 fields at most: period (usually month) number, loan payment
(unnecessary, could be dropped), interest portion, principal portion,
and principal balance.
Principal balance in month M is always principal balance from the
preceding month, M-1, less the principal portion in the current month,
M.
Let me help you. Given initial loan amount, A, periodic effective
interest rate, R, and loan term in periods, N, the fixed loan payment,
P, is given by PMT(R,N,-A) [you're free to gripe about the need for the
sign convention - I do]. The first column is a given: month numbers
from 0 to N. The rest of the first record is also a given: zeros for
interest and principal portions, initial loan amount, A, for principal
balance.
The calculations for the interst portion are simplest (at least in
Excel).
Interest Portion in M = Principal Balance in M-1 * ((1 + R) - 1)
Principal Portion in M = P - Interest Portion in M
Principal Balance in M = Principal Balance in M-1 - Principal Portion
in M
Getting the periods into the amortization table (at) would require
either entry of period numbers in the first field or an insert query
against an existing table (s) with a field (s) running in sequence from
0 to N. Something like
INSERT INTO [at] ( m )
SELECT s.s
FROM s LEFT JOIN [at] ON s.s = at.m
WHERE (((s.s)<=[N]));
Then set the initial (period 0) principal balance to the initial loan
amount using something like
UPDATE [at]
SET [at].pb = [A]
WHERE (((at.m)=0));
However, at that point it gets a bit difficult for SQL because all the
remaining calculations are ORDER DEPENDENT and RECURSIVE. The good news
is that there are other ways to build amortization tables by
calculating the principal portion of each level payment separately.
Principal Portion in M = P / ((1 + R) ^ (N - M + 1))
This can be done with another update query.
UPDATE [at]
SET [at].pp = [P]/((1+[R])^([N]-at.m+1))
WHERE (((at.m)>0));
Then the corresponding interest portions are just the level payment
less the principal portion. Another update query.
UPDATE [at]
SET [at].ip = [P]-at.pp
WHERE (((at.m)>0));
Finally, the principal balances require a somewhat more complicated
update query.
UPDATE [at] AS at1 INNER JOIN [at] AS at2 ON at1.m-1=at2.m
SET at1.pb = at2.pb-at1.pp;
5 queries of which of which one is an insert and the other 4 are
updates, and the final update requiring an inner join, along with the
fact that a SQL approach *REQUIRES* using the more complicated direct
calculation of principal portions rather than the much simpler direct
calculation of interest portions would only appear to your warped mind
as simpler than the Excel approach.
- The more recent challenge: how would calculate a 5-point moving
average in Access?
A NON-EQUIJOIN x5
select sum(t1.value) + sum(t2.value) + sum(t3.value) + sum(t4.value) +
sum(t5.value)
from myTable t1
inner join mytable t2 on t1.mydate = (t2.mydate - 1)
inner join mytable t3 on t1.mydate = (t3.mydate - 2)
inner join mytable t4 on t1.mydate = (t4.mydate - 3)
inner join mytable t5 on t1.mydate = (t5.mydate - 4)
Average, not sum, where's the division by 5?
Also, Access 2002 chokes on this: Syntax error (missing operator) in
query expression 't1.mydate = (t2.mydate - 1) [...] = (t5.mydate - 4)'.
If a self-proclaimed expert like you can screw this up, how could you
believe this would be simple for people who aren't database experts?
- How would you calculate the risk premium for a bond from an issuer
with a BB rating?
HAVE A RATINGS TABLE AND A TABLE VARIOUS FACTORS
Gosh! A table!
And use formulas, er, expressions to calculate the result! And just how
would the expressions in a dbms differ from the formulas in a
spreadsheet?
Also, risk premium is a function of how long you intend to hold the
bond. Make that a cell reference in a spreadsheet formula. In a dbms
approach, you could make it a query parameter, but you'd need to rerun
the query as well as change the parameter - 2 steps - as opposed to
just entering a new value in a precendent cell and letting a
spreadsheet automatically recalc the new result.
- How would you perform what-if analysis on construction project NPVs
under varying interest rates, factor costs and duration?
DATA ENTRY FORMS-- LETTING SOMEONE ENTER A 'VARYING INTEREST RATE'
And the varying factor costs and project duration? Especially with the
factor costs varying over time as an autoregressive time series, so
needing an inner join between a table and itself.
Your answer is vacuous.
Databases are pathetic for what-if analysis.
- How would you calculate the McCauley duration of a bond in Access?
http://bluecollardollar.com/bonds_measuring_risk_03.html
sum of pv divided by share price you really thikn that databases can't
do math that complex? ....
add up a couple of numbers and divide by another number
Databases are much harder to use for order-dependent calculations like
the pv calculation you mention. It's more complicated than you seem to
believe, but that's because you really don't understand these
calculations. They can be done in databases, but they're much easier in
spreadsheets. In Excel, all you'd need to do is load the Analysis
ToolPak (which, unlike all the extras you assume when you say Access,
comes on the Excel or Office CD) and use the DURATION function.
databases are MUCH better with math than either you or Excel is
Since all you seem to know is adding and occasionally subtracting,
databases may be adequate for you, but that doesn't mean they're
adequate generally for calculations.