473,387 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to Update Query using Total Count

15
I have two tables.. I want to update one table with the count of each colume from the pervious table. I have been able to do it using the query bulider and when ran, it works but I want to take the SQL statment and copy it into my moduel however it won't work. It will not let me format the SQL statment and remove put the whole statement on one line. I'm new at this so I don't really understand why I am unable to do this. Below is the code I have. I also have done this with other update querys that I didn't count, just simply copied from one table to another and that worked fine.

I use db.execture "the sql stament" because the query is so long it copies it one two lines and when I try and make it all one one line it doesn't work. Its at the point where its (SELECT COUNT(BlockRegenTemp From BLOCKNUM) AS CountOfBLOCKNUM.


Thanks
Jul 7 '10 #1
4 2400
NeoPa
32,556 Expert Mod 16PB
Dawn, please try to explain this using code (in CODE tags) that is copy pasted. Typos in code are unnecessary and can waste much time and effort.

By the way, I'm pretty confident we can help once we have a clearer understanding of the question.

Welcome to Bytes!
Jul 7 '10 #2
nico5038
3,080 Expert 2GB
When you have a working query, just execute this like:

Expand|Select|Wrap|Line Numbers
  1. CurrentDb.Execute ("Your_qryUpdate_Name")
  2.  
Nic;o)
Jul 7 '10 #3
dawn123
15
Thanks for your reply! Thats what I used and it worked. But I also figured out why it would't work the other way in the first place.. Pretty simple and stupid of me but I have never had it happen before so I did learned from it. It was that my query was to long for one line.. I got it working now so thats what matters! Thanks again for all the help! :)
Jul 8 '10 #4
NeoPa
32,556 Expert Mod 16PB
That's all good then. Well done :)
Jul 8 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jonathan Patton | last post by:
Hi,=20 I have a query that runs in Microsoft Access against my mysql database = just fine. It is:=20 =20 UPDATE discussion_categories AS discussion_categories_1=20 INNER JOIN...
1
by: sivaram | last post by:
Hi all, I have the following query in Visual Foxpro that is throwing error. UPDATE T1 set T1.C2 = (select T2.C2 from T2 where T1.c1 = T2.C1)
0
by: John N. | last post by:
Hello, I'm trying to update the value of a field which is equal to the count of the number of related records in a related table. So far, my SQL statement looks like this: UPDATE PullBoxes...
4
by: Kannan s | last post by:
Dear Sir, Sub: help requred to build an Update Query using if or iif I am having two tables with the following fields I wish to create a single update query in MS Access Table1: code,...
1
by: Stout | last post by:
I have an inventory db that I use to catalog tapes. I am using a tab control with three tabs. One tab is for data entry and another tab is to view all tapes. My problem is that when I delete a...
1
by: DrSwens | last post by:
Using MS Access 2002/XP I am trying to create an update query which will count the number of times a particular item has been referenced in another table and store that value in the first table. For...
2
by: midlothian | last post by:
Hello Trying to update a memo field in an update query using the Replace function, and am getting a type conversion error. Here is my parameter: CStr(Replace(CStr(),"$",Chr$(13) & Chr$(10))) ...
2
by: CK | last post by:
UPDATE Sales.DeliverySchedule SET DeliveryList.modify('declare namespace df=http://schemas.adventure-works.com/DeliverySchedule; replace value of (df:DeliveryList/df:Delivery/df:Address)' with...
0
by: nagar | last post by:
I'm using SQLite with the ADO.NET 2.0 SQLite Data Provider as the storage of my application. I chose to use an untyped dataset and I'm using a dataadapter to report changes to the DB. The query...
1
by: themightyrhino | last post by:
I'm writing a process to perform multiple updates on a main table from information stored in different component reports. As you can see from the below, I'm using a select query to base the update...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.