473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

A Query / Report Question with a difference.

Thanks for the replies to my earlier question I am now ready to take another
step.

For Tax purposes I need to show how much of the mileage of my car is
business and how much is private.

I have a table in which I record my business trips.
It has the following fields

Date /description / startmiles / endmiles

I can set up a simple parameter query and report that gives me a list of
business trips for any period.

So far so good.

I'm not very familiar with SQL or VBA at the moment.

To calculate the business %

I think I need to do the following and aren't sure how.

Total business miles for the month. This I can do.

Find the row before the first row in the parameter query.

Extract the ENDmiles figure from that row to use as a variable(?)
Monthstart.

This is the bit that foxes me.

Find the maximum endmiles figure from within the parameter query.
I assume =Max([endmiles]) would work.

My business miles then become

Sum ([Business Miles]) / (Max([endmiles]- [monthstart])
Thanks for any assistance.

Mike

www.mikethebass.moonfruit.com

Mar 5 '06 #1
0 1105

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dalan | last post by:
I have a form that contains a lot of individual rows of text boxes with dates and totals. Although one can view the form to see the accumulative totals, what I would like to do without redoing the...
1
by: Simon Bailey | last post by:
I currently have a query calculating the gap in days between two dates. The fields being "DateLookedAt" and "DateResolved" plus the calculated field "TimeTaken". I am looking to add another...
15
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows...
0
by: raf_z | last post by:
Hi, I think i'm doing something simple, although i may be wrong. I was able to load a Crystal report file up until today, and even now, its only 1 report that's misbehaving. I'll confess that i...
2
by: deekay | last post by:
Im trying to update a database where our users have been entering/editing all data using queries to now use forms instead. The first step that I want to take is to convert the queries to forms in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.