I suggest you to first try as select statement to see if you can create a select statement of what the fee would be. Turning select statement into update is usually not hard, but it always helps to first try a SELECT to see the result before the actual update.
why update function cant related 2 table?
I have 2 table which first is header of Commodity purchase information and second is Information on the purchase of goods. in second table i have fee of my goods and I need to change fee of goods of in some number of first table for example update fee from first table which date of second table between 01.01.2022 an 02.02.2021
first and second table are one form that first is header of purchase and second is item of my purchase
do you think is it possible ?
2 answers
Sort by: Most helpful
-
-
LiHong-MSFT 10,046 Reputation points
2022-02-15T07:38:28.797+00:00 Hi @gholamreza rezaie
Since the information you provided is not enough, I can only guess that you might to UPDATE using JOIN OR CTE.
Please refer to these two articles : Inserts and Updates with CTEs in SQL Server (Common Table Expressions) and SQL Server UPDATE JOIN
If not helpful ,still recommend you share us your table structure (CREATE TABLE …) and some sample data(INSERT INTO …) along with your expected result.Best regards,
LiHong