Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update table on query when the field is on another table?

Status
Not open for further replies.

awinnn

MIS
Jul 21, 2003
166
MY
Hi,
I want to update table, [leave] with field carryfwd, annual and year. Every year, the data will be changed (except for annual field). My problem is to set new carryfwd value. This is because, the new carryfwd should be total(carryfwd + annual) - total(daystaken).

While table, [leavedetail] has leavecode, startdate, and enddate. Daystaken is difference of enddate and startdate.

Table [leave] and [leavedetail] is linked by another table, [staffdetail].

How do i include table [leavedetail] into this query?

Code:
UPDATE [leave] SET [leave].carryfwd = ([leave].[carryfwd]+[leave].[annual]), [leave].[year] = 2004
WHERE ((([leave].[year])=2003));

any idea?
thanx in advance..;)
 
You could use a nested SQL statement in the query, provided that I am understanding you correctly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top