Thank you so much for your help. It was very stupid of me. I used the wrong table. I should use last year table for rate cuz we do not have any data yet for current year. I apologize for wasting so much of your time.
Thanks for your advice. I've tried this code when i export the data but I get NULL value for totalRate. Could you please take a look to see what I did wrong ? Please!
SELECT dbo.parcel_tax.strap, SUM(dbo.lu_tax_dist.curr) AS TotalRate
FROM dbo.parcel_tax LEFT OUTER JOIN...
Hi all,
What I need is to get the total rate for each account and write it to a new table with that distinct account# (strap) & its total rate.
table: parcel_tax
strap tax_dist
12345 001
12345 002
12345 003
12345 004
01111 001
01111 007
01111 003...
Sorry! please forget about my previous email. The error was actually from INNER JOIN down.
This is what I have:
Table1: lu_mill_cd
Table2: lu_tax_dist.curr
I manually added field 'total_rate' to 'lu_mill_cd' table
***my code***
UPDATE lu_mill_cd
SET lu_mill_cd.total_rate = lu_tax_dist.curr...
Hi I have a syntax error return on line
GROUP BY Table2.Code) Table1
and I notice it has 1 single ")" I tried a couple things there but none works since I do not fully understand the codes yet. Sorry for taking too much of your time.
Million thanks. All my servers are down so I haven't able to test the codes yet. I'll let you know the result as soon as I know. I notice 1 thing though. Since my table 2 does not have field "rate" yet, I still have to include this line right ?
DECLARE @Table2 TABLE (Rate Numeric(10,4))...
Thanks a lot for your quick response. I forgot to tell you that both my tables have thousands of record. In that case I guess I can not use what you suggested. I have to use some kind of loop to loop through and match the records right ? I'm completely unfamiliar with SQL statements, so...
Hi,
What I have to do is to calculate the total rate for each code (in table 2) and insert that total rate field in that same table (2). I've never written any SQL codes except for simple select statements. Any help is greatly appreciated.
Table1:
CD Rate
001 1.5
002 1.25
003 0.5...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.