C
chrisfres
From what I have found so far, I don't think I'm going to be able to
pull this off, but perhaps someone here can help me out.
The database is a SQL/MSDE database. I'm using an access 2000 project.
(adp).
This is a registration database for a music school. We are forced to
raise our tuition rates starting in February. Charges through June are
already in the database--there are about 4500 fields to update, so of
course I want to do an update query.
I have two tables: [CHARGES] and [CHARGES_DETAIL].
Charges.ID is linked to Charges_Detail.Charge_ID.
I need to update the Amount field in BOTH tables.
The Due Date field only exists in the Charges table (Charges.Due_Date).
Updating the CHARGES table is not a problem. The following stored
procedure worked great:
UPDATE dbo.Charges
SET Amount = 66
WHERE (Due_Date = CONVERT(DATETIME, '2006-02-06 00:00:00', 102))
AND (Amount = 55)
However, updating the CHARGE_DETAIL table! I only want to update the
charge details that are linked to the charges with the due date after
2/1/06. Access won't let me pull criteria from a second table--it'll
only let me work on one table.
Here's the stored procedure that I created:
ALTER PROCEDURE dbo.[charge detail change3]
AS UPDATE dbo.Charges_Detail
SET Amount = 99
WHERE dbo.Charges_Detail.Amount = 82.50
AND dbo.Charges.Due_Date = CONVERT(DATETIME, '2006-01-25 00:00:00',
102)
When I run it, I get feedback that it ran successfully, but returned no
records. And sure enough the records in the charges_detail were not
updated.
I'm sure there is something I'm missing and/or just don't know about.
Can someone pretty please help me out?
Thanks!
Chris
pull this off, but perhaps someone here can help me out.
The database is a SQL/MSDE database. I'm using an access 2000 project.
(adp).
This is a registration database for a music school. We are forced to
raise our tuition rates starting in February. Charges through June are
already in the database--there are about 4500 fields to update, so of
course I want to do an update query.
I have two tables: [CHARGES] and [CHARGES_DETAIL].
Charges.ID is linked to Charges_Detail.Charge_ID.
I need to update the Amount field in BOTH tables.
The Due Date field only exists in the Charges table (Charges.Due_Date).
Updating the CHARGES table is not a problem. The following stored
procedure worked great:
UPDATE dbo.Charges
SET Amount = 66
WHERE (Due_Date = CONVERT(DATETIME, '2006-02-06 00:00:00', 102))
AND (Amount = 55)
However, updating the CHARGE_DETAIL table! I only want to update the
charge details that are linked to the charges with the due date after
2/1/06. Access won't let me pull criteria from a second table--it'll
only let me work on one table.
Here's the stored procedure that I created:
ALTER PROCEDURE dbo.[charge detail change3]
AS UPDATE dbo.Charges_Detail
SET Amount = 99
dbo.Charges_Detail.Charge_ID = dbo.Charges.IDFrom dbo.Charges_Detail INNER JOIN dbo.Charges ON
WHERE dbo.Charges_Detail.Amount = 82.50
AND dbo.Charges.Due_Date = CONVERT(DATETIME, '2006-01-25 00:00:00',
102)
When I run it, I get feedback that it ran successfully, but returned no
records. And sure enough the records in the charges_detail were not
updated.
I'm sure there is something I'm missing and/or just don't know about.
Can someone pretty please help me out?
Thanks!
Chris