If you are using a version of DB with plugins you can use the report plugin.
This will let you select a field and for a numeric field it will tell you the
highest and lowest values, the average value and (what you want) the total
value. This will of course be the entire total and will not help if you want
to keep all your expenses in one database, but (for example) get the total at
the end of the tax year (you could have a separate database for each tax year
and if short of memory run the old years on POSE.
For an accumulating total field you need to use a script (calculated field).
This would be something like the following:
(sort 0 1) (+ %5 (ffr 6 -1 0))
[Quick Translation sort on the first field (e.g., date) in ascending order,
then add the current records mileage/expenses (here field 5) to the
accumulating total field (here Field 6) of the previous record. If there is
no previous record enter a default value of 0. This fuller translation of
this code is available from the manual that came with your download or is
available on the DB website; Chapter 9 Scripts: Inter-Record Sripts.
Obviously you need to do the above separately for totalling your mileage and
expense totals. Neither scripts nor the report plugin with work on fields
linked from another database, becasue the values in all link(ed) fields are
converted to strings. Apparently you can convert the linked string to a
float, but I have not got it to work, so I just link that field and then have
a float field into which I type the number in the linked field.
I do not know of any websites, I worked out how to use the script (after
reading the manual by doing a search on the DB Mailing List. Since
discovering the report plugin I have removed the Total scripts from my
databases.
Hope that helps.
--
Mark Walker
On Tuesday 10 June 2003 19:22, Craigery's TOR Account wrote:
> Hi,
>
> I'm VERY new at the whole world of Database Scripts. I was wondering if
> anyone could point me to some helpful sites on how to get started. I'm
> trying to create a database to keep track of my vehice milage and expenses.
> I want to have an accumulated field for the milage and another for the
> expenses.
>
> Thanks for any help you can give.
>
> -Craigery
|