473,325 Members | 2,792 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,325 software developers and data experts.

Need help with Update query

dee
I have a table 'LeadHistory' which has among others, the following
fields.

Salesman(Text)
SalesmanAssmntDate(Date/Time)
Disposition(Text)

I also have a table 'LookUpSalesman' which has among others, these
following fields.

Salesman(Text)
NumSits(Number)
NumSales(Number)

I'm trying to make a query or queries which would count the records in
[LeadHistory].[Disposition] = "Sit Assigned" for each Salesman, and
then update the [LookupSalesman] table with these counts accordingly.
Now I'm stumped. I attempted to design the query to update the
'LookUpSalesman' table.

UPDATE LookUpSalesman SET LookUpSalesman.NumSits = DCount("
[LeadHistory]![Disposition]","LeadHistory","[LeadHistory]![Disposition]
= ""Sit Assigned waiting Disposition"" ");

It updates every salesman's 'NumSits' field with the total count of
"Sit Assigned" occurrences in the 'LeadHistory', regardless of who the
salesman was.

What I need is to update each salesman's 'NumSits' field with "Sit
Assigned" occurrence count for only those records that match his name.

I'm not a programmer and don't know how to do this, though I've tried
for 2 days now. Could someone help? Please?

Dec 28 '06 #1
1 1474
Please don't multipost. I took the time to write up a lengthy message for you
explaining the problems with your table structure, how to fix it and I designed
queries to get what you want -- and then I discovered you had posted this
question elsewhere, and it had already been answered. You didn't have the
courtesy to return to this thread to write, "Sorry. I don't want responders to
duplicate their efforts, so I'm abandoning this thread in favor of the other
one."

Please see the following Web page to find out what you can expect and what is
expected of you when participating in the newsgroups:

http://www.mvps.org/access/netiquette.htm

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"dee" <pr******************@comcast.netwrote in message
news:11**********************@n51g2000cwc.googlegr oups.com...
>I have a table 'LeadHistory' which has among others, the following
fields.

Salesman(Text)
SalesmanAssmntDate(Date/Time)
Disposition(Text)

I also have a table 'LookUpSalesman' which has among others, these
following fields.

Salesman(Text)
NumSits(Number)
NumSales(Number)

I'm trying to make a query or queries which would count the records in
[LeadHistory].[Disposition] = "Sit Assigned" for each Salesman, and
then update the [LookupSalesman] table with these counts accordingly.
Now I'm stumped. I attempted to design the query to update the
'LookUpSalesman' table.

UPDATE LookUpSalesman SET LookUpSalesman.NumSits = DCount("
[LeadHistory]![Disposition]","LeadHistory","[LeadHistory]![Disposition]
= ""Sit Assigned waiting Disposition"" ");

It updates every salesman's 'NumSits' field with the total count of
"Sit Assigned" occurrences in the 'LeadHistory', regardless of who the
salesman was.

What I need is to update each salesman's 'NumSits' field with "Sit
Assigned" occurrence count for only those records that match his name.

I'm not a programmer and don't know how to do this, though I've tried
for 2 days now. Could someone help? Please?

Dec 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: gondor | last post by:
hi! i have a problem with a update-query: start-structur (column 1 index, 2 datetime, 3 time of measurement, 4-6 values): 1 | 0000-00-00 00:00:00 | 0 | 21 | 22 | 23 2 | 0000-00-00 00:00:00...
6
by: mo | last post by:
I need to bring the ssn's into UniqueSups (supervisors) from tblNonNormalized. My inherited DB is not normalized and I find it extremely irritating due to the workarounds needed. I created...
4
by: rdraider | last post by:
I am looking for some assistance with an update query that needs to link 3 tables: This query ran and reported over 230,000 records affected but did not change the field I wanted changed, not...
2
by: D Newsham | last post by:
I am trying to run an update query and am having problems with null values. Starting from the beginning - I created a new table from my original table, selecting distinct combinations of these...
2
by: nadmasl | last post by:
I have an MS Access form, where a user enters the date by selecting it from three combo boxes for day, month and year. I convert it to 11-Jan-2004 format and attempt to write to the table with an...
1
by: san | last post by:
Hi, I have the following update statement that updates one table by the values from the other table which seems have some problem with the syntax. UPDATE tblResolve SET...
46
by: arion | last post by:
Hello, I am working on a very complex database and now I am trying to create an update query. The query is showing too few records. I am trying to update data in the table "inventory" with data...
1
by: jonathan184 | last post by:
I got a perl script that i am reading from a txt file I then parse the data which all works but when i run the update queries I get an error you have an error in your sql synax this is the...
7
by: kcr2007 | last post by:
Hi everyone. Sure it's simple, but... Have a field "Picture" in a table. I need to change ONE word within the field across all records, but keep all the other info the same. Update query? ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.