Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 27th, 2006, 08:30 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default What is wrong with this query?...

update table1
set brand = 'Acer',Server_Size='Low-Range',Sales_Chl='Direct',CountQ1=Sum(Q1)
where brandid = 'Acer' and Q2_1_1 > 0 and Q3_1_1 > 0

in access it gives error as
You tried to execute a query that dosen't include Brand as an aggregate function.

Any idea..

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old April 28th, 2006, 02:46 AM
Authorized User
 
Join Date: Mar 2006
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
you can't use Sum in UPDATE query
Peko

 
Old April 28th, 2006, 05:24 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

Okay thanks. Then what i should do if i want to carry out such operation?

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old April 28th, 2006, 05:44 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Rupen & peko!!

Offcourse you can use Sum in update query ;)




Cheers :)

vinod
 
Old April 28th, 2006, 07:34 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

HI Rupen & peko!!
 check help option with "Operation must use an updatable query."
you can find domain function for Update query

Hope this will help you


Cheers :)

vinod
 
Old April 30th, 2006, 01:28 AM
Authorized User
 
Join Date: Apr 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There might be a more elegant way to do it, but, a common way I get around alot of aggregate issues and action query constraints is to do all of your agregations in one query, then do an update/delete/append in a second query.






Similar Threads
Thread Thread Starter Forum Replies Last Post
What is wrong with following Insert Query? [email protected] VB.NET 2002/2003 Basics 1 September 19th, 2006 04:41 PM
Query on the wrong data type ggiibboo VB Databases Basics 1 January 31st, 2006 07:44 PM
Wrong result on select query penta Access 3 May 5th, 2005 09:05 AM
What`s wrong with Query??? :( Varg_88 Classic ASP Basics 8 January 18th, 2005 09:41 AM
What is wrong with this Query? Section? xgbnow Pro VB Databases 3 February 9th, 2004 05:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.