SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 6th, 2003, 03:24 PM
kcsabresfan kcsabresfan is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 5 kcsabresfan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
annoying problem with a query

Here's my problem... I've created a query to pull the data I need but it is not updateable. However, the whole point of the query was to update a table with it... so I have a second query that pulls the data from the first and attempts to update the table.

All I can get it to do is error out and tell me I must have an updateable query. But I'm not trying to update the query, I'm trying to update the updateable table. (this is all in Access)

first query is:
SELECT
ROUND(Avg((report.onin+report.offin)/IIf((report.son+report.soff)=0,1,(report.son+repor t.soff))),2) AS ptotal,
EIDCrossRef.EID
FROM (report INNER JOIN agent ON report.aid = agent.AGENT_ID) INNER JOIN EIDCrossRef ON agent.SOCIAL_SECURITY_NO = EIDCrossRef.SSNNumber
WHERE report.date Between [start_date] And [end_date]
GROUP BY EIDCrossRef.EID;

update query is:
UPDATE
cmgscoresdvr_cmgresults_local cmgres
SET
cmgres.ADH = (
SELECT ptotal
FROM qryReportAvgsByDate
WHERE cmgres.EID=qryReportAvgsByDate.eid)
WHERE
cmgres.YEARMONTH=[YearMonth];

Any thoughts? what can I do?

Reply With Quote
  #2  
Old November 6th, 2003, 06:12 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 9 m 49 sec
Reputation Power: 181
Give the IUSR_computername user write permissions to your access db.

http://www.dougscode.com/forum4/topic.asp?TOPIC_ID=5

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > annoying problem with a query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT