Basic sql query in microsoft access error -


select  query1, table2, table3 update table2 set companycount=(select count(*) table3 table2.case#=table3.case2#) ; 

here query trying run keep getting error messages in access stating sometthing in select misspelled or wrong. know why happening? if vague please let me know , give more info. in advance!

edit: case,case2, , companycount column names edit2:

ok sorry being vaugue data confidential cannot give but. have 2 tables multiple columns have done inner join in query 1. instructed add column first table:'table2' find multiple values(what mean there column item number, country/state, , check amount. there can multiple of same item in different states , countries.) person mannually put in data didnt divide $ amount in 'check amount' column number of same item. example have 1 item, distributed 3 countrys take 3 rows on data table. instead of dividing total cost $13,000 3, data states $13,000 each of 3 rows in 'check amount' column. want achieve is, want update items distributed multiple companies , change 'check amount' reflect amount of countries distributed in.(so item 1=$13,000 in 3 countries. end result should each country's 'check amount' should $4,333 instead of $13,000) please let me know if of makes sense , in advance.

i'm guessing trying this

  update t2   set t2.companycount= a.numb   table2 t2, (select [case2], count(1) numb table3 group [case2])   t2.[case]=a.[case2] 

sorry, above have worked on sql server, try following access

update table2 t2 inner join  (select [case2], count(1) numb table3 group [case2]) on a.[case2]=t2.[case] set t2.companycount=a.numb 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -