Re: Update table with SQL
- From: "Roger Svensson" <roger.svensson@xxxxxxxxxxxxx>
- Date: Tue, 22 Aug 2006 11:05:24 +0200
I tried to type:
update TABLE1 set Column1 = (select count(*) from TABLE2
where([TABLE2].[Column2]=2))
Still without any success though...
"Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx> wrote in message
news:e8xj3hcxGHA.560@xxxxxxxxxxxxxxxxxxxxxxx
Access will interpret the quotes as a literal string, so the where clauseof
the query is comparing a literal string to a number.an
Perhaps you want something like this:
update TABLE1 set Column1 =
(select count(*)
from TABLE2
where (Table2.Column2 = Table1.Column2));
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Roger Svensson" <roger.svensson@xxxxxxxxxxxxx> wrote in message
news:%23koZ3AcxGHA.4876@xxxxxxxxxxxxxxxxxxxxxxx
I have a SQL query that works fine on an SQL server database but not on
equivalent Access database. Can anyone please help me tune the query to
function in Access?
The query looks like this:
update TABLE1 set Column1 = (select count(*) from TABLE2
where("Column2"=2))
.
- References:
- Update table with SQL
- From: Roger Svensson
- Re: Update table with SQL
- From: Allen Browne
- Update table with SQL
- Prev by Date: Re: Update table with SQL
- Next by Date: Re: Rounding to nearest 1000
- Previous by thread: Re: Update table with SQL
- Next by thread: Re: Update table with SQL
- Index(es):