Update Table

G

Guest

I have a table which needs to be updated with data from another table. The
problem is the second table has 2 data fields and I cannot link the 2
tables...........

Table one contains Transaction data such as [Date] [From] [To] [Trucker]
[Trucker Cost]. I need to update a field [FSC]. "Fuel Surcharge"

The rates are maintained in another table "FSC Rates" because the rate
changes weekly. It only has 2 data fields [Effective date], [FSC].

I need to update table one based on the [Date] of the activity and the
[Effective date] in the rate table.

ie: [Max of Date] where [Date] is less than the [Effective Date]

How do I perform this task?

Do I need to change my table structure?

Thanks
 
G

Guest

Try this query to find the effective FSC rate for each Date. Then us an
update query to do the updating.

P.S. You should use a different name for your field other than Date.
 
G

Guest

The Field name is not Date - I just used it to simplify my explanation.

Thanks
--
A MACKENZIE, CMA, MBA


KARL DEWEY said:
Try this query to find the effective FSC rate for each Date. Then us an
update query to do the updating.

P.S. You should use a different name for your field other than Date.

aMack said:
I have a table which needs to be updated with data from another table. The
problem is the second table has 2 data fields and I cannot link the 2
tables...........

Table one contains Transaction data such as [Date] [From] [To] [Trucker]
[Trucker Cost]. I need to update a field [FSC]. "Fuel Surcharge"

The rates are maintained in another table "FSC Rates" because the rate
changes weekly. It only has 2 data fields [Effective date], [FSC].

I need to update table one based on the [Date] of the activity and the
[Effective date] in the rate table.

ie: [Max of Date] where [Date] is less than the [Effective Date]

How do I perform this task?

Do I need to change my table structure?

Thanks
 
G

Guest

Karl:

Not sure what "query" you refer to.

If the in: microsoft.public.access.queries is a link it doesn't take me
anywhere.

What am I doing wrong?


--
A MACKENZIE, CMA, MBA


KARL DEWEY said:
Try this query to find the effective FSC rate for each Date. Then us an
update query to do the updating.

P.S. You should use a different name for your field other than Date.

aMack said:
I have a table which needs to be updated with data from another table. The
problem is the second table has 2 data fields and I cannot link the 2
tables...........

Table one contains Transaction data such as [Date] [From] [To] [Trucker]
[Trucker Cost]. I need to update a field [FSC]. "Fuel Surcharge"

The rates are maintained in another table "FSC Rates" because the rate
changes weekly. It only has 2 data fields [Effective date], [FSC].

I need to update table one based on the [Date] of the activity and the
[Effective date] in the rate table.

ie: [Max of Date] where [Date] is less than the [Effective Date]

How do I perform this task?

Do I need to change my table structure?

Thanks
 
G

Guest

OOPS!
Forgot to paste.

SELECT aMack.Date, Max([FSC Rates].[Effective date]) AS [FSC Effective
Date], Last([FSC Rates].FSC) AS [FSC Rate]
FROM aMack, [FSC Rates]
WHERE ((([FSC Rates].[Effective date])<=[date]))
GROUP BY aMack.Date;


aMack said:
Karl:

Not sure what "query" you refer to.

If the in: microsoft.public.access.queries is a link it doesn't take me
anywhere.

What am I doing wrong?


--
A MACKENZIE, CMA, MBA


KARL DEWEY said:
Try this query to find the effective FSC rate for each Date. Then us an
update query to do the updating.

P.S. You should use a different name for your field other than Date.

aMack said:
I have a table which needs to be updated with data from another table. The
problem is the second table has 2 data fields and I cannot link the 2
tables...........

Table one contains Transaction data such as [Date] [From] [To] [Trucker]
[Trucker Cost]. I need to update a field [FSC]. "Fuel Surcharge"

The rates are maintained in another table "FSC Rates" because the rate
changes weekly. It only has 2 data fields [Effective date], [FSC].

I need to update table one based on the [Date] of the activity and the
[Effective date] in the rate table.

ie: [Max of Date] where [Date] is less than the [Effective Date]

How do I perform this task?

Do I need to change my table structure?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top