Thanks for the info, but it is useless unless I have SQL Server right? If I
did, I'd be on a SQL forum. But I don't so I'm on an Access forum. Do you
use Access? If not, then why are you here? This is for Access users isn't
it?
BTW, I don't like your delivery of the message. It is riddled with a "My
way's better than your way" supremacist attitude. If I get around by riding
a bike I really don't appreciate someone cruising by, laughing at me and
yelling "Get a Maserati!"
I've read your other posts in this thread and I see that the attitude
carries throughout. I suspect that Bob Q asks you to leave because your
attitude is unbecoming of an intelligent being and your suggestions are
inappropriate for this forum (people here help each other with ACCESS, not
SQL Server).
Perhaps if you go post on a forum dedicated to SQL Server you will get
positive feedback rather than the invitations to leave you get here.
It has become apparent to me that this is how you entertain yourself -
insulting Access and denegrating the choices people have made to use it -
basically it seems like you are trying to pick a fight online. Why? What's
the purpose? Who does it help? It seems to only gratify your ego because
you have the 'bigger' tool: SQL SERVER! So what! Who cares..
I, for one, will now ignore your thinly-veiled insults and ridicules. Have
a nice life and stay away from me please as I do not appreciate the way you
deliver information - it is really insulting to be 'talked down' to and
insulted for my choice of data manipulation tool.
Good bye...
--
rpw
because with Access MDB; you can only store this in a query.
You can't bind a calculation to a table.
In SQL Server, you can make a new columns 'ExtendedPrice' which is
equal to Quantity * Price.
In Access, you can write the equation in 300 places -- for all I care.
But in SQL Server; this is much easier.
Thanks & Good Luck (choosing better database architectures in the
future!)
Hi Frank,
The calculation is part of the query and I'll provide you with a sample that
you will have to translate to your exact needs. However, the idea that you
have about saving that calculation to another table is against the norm in db
design and we can discuss that later. Here's what you do to accomplish the
query (using the example I used earlier):
Get to the Query Design view
Add the two relevant tables (tblRates, tblUserInput)
Double-click the relevant fields to add them to the query (RateName,
RateAmt, UserQuantity)
For the fourth field, click into the 'Field' row and then click the
'Builder' wizard button-this will open the Expression Builder. Using this,
you should be able to select the fields from the tables and/or queriesthat
you want to use in the calculation. The result would look somethinglike
this:
CalcTotal: [tblRates].[RateAmt] * [tblUserInput].[UserQuantity]
From reading your previous posts, I think that you'll be able to adaptthis
to your table and field names and make it work for you.
One thing concerns me and that is how you will relate the user input to a
particular driver or vehicle, but if you've got that covered then I'm
fretting uselessly.
As far as storing the calculated field into another table - why? How is
storing it any better than letting Access recalculate it again when you need
it?
--
rpw
Table one hours are a persons (drivers) time and the miles are the amount of
miles they drove in that specified time. We pay the person by both hours and
miles driven. Hence the hourly rate and the per mile rate. While therates
remain constant the time and miles vary. I have other tables that are related
such as address from and delivery address, date of delivery, driversname,
ect. This is kind of like a billing and payroll database for a very small
business.
Your example:
RateName RateAmt UserQuantity CalcTotal
Hours 36.50 2 73.00
Miles 00.75 37 27.75
is exactly what I am trying to accomplish.
tblRates
RateID (primary key - keeps things organized in Access' mind)
RateName (text - the name of the rate)
RateAmt (currency - the amount of the rate)
tblUserInput
InputID (PK-primary key)
RateID (FK - aka 'foreign key' because this is how this table 'relates' to
the tblRate)
UserQuantity (number - this is what the user inputs after selecting a rate)- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -