Hi All,
I have 2 tables. One has a detailed Sales transaction by OrderID, CustID (that is unique ID for each customer) Customer. for e.g.
Table Name: tbl_Sales_CUST
CustID Customer Sales
1234 John 20
1234 John 35
5544 Jill 25
5544 Jill 25
I have another table called "tbl_VAR" that has Customer specific data. In that table there is a "SalesToDate" field. How do I update this table with the sum of Sales from tbl_Sales_CUST .... for e.g.
Table Name: tbl_VAR
CustID Customer Sales Country Region ....
1234 John 55
5544 Jill 50
I am using the DSUM function in the "update to" section of an UPDATE QUERY.
DSum("Sales","tbl_SALES_CUST","[tbl_SALES_CUST].[CustID] =" [tbl_VAR].[CustID])
(note, I have tried switching the criteria otehr way round with no luck
DSum("Sales","tbl_SALES_CUST","[tbl_VAR].[CustID] =" [tbl_SALES_CUST].[CustID])
I get a "TYPE CONVERSION ERROR". Please help.
Thank you,
RJ
I have 2 tables. One has a detailed Sales transaction by OrderID, CustID (that is unique ID for each customer) Customer. for e.g.
Table Name: tbl_Sales_CUST
CustID Customer Sales
1234 John 20
1234 John 35
5544 Jill 25
5544 Jill 25
I have another table called "tbl_VAR" that has Customer specific data. In that table there is a "SalesToDate" field. How do I update this table with the sum of Sales from tbl_Sales_CUST .... for e.g.
Table Name: tbl_VAR
CustID Customer Sales Country Region ....
1234 John 55
5544 Jill 50
I am using the DSUM function in the "update to" section of an UPDATE QUERY.
DSum("Sales","tbl_SALES_CUST","[tbl_SALES_CUST].[CustID] =" [tbl_VAR].[CustID])
(note, I have tried switching the criteria otehr way round with no luck
DSum("Sales","tbl_SALES_CUST","[tbl_VAR].[CustID] =" [tbl_SALES_CUST].[CustID])
I get a "TYPE CONVERSION ERROR". Please help.
Thank you,
RJ