A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update query



 
 
Thread Tools Display Modes
  #1  
Old April 11th, 2005, 05:01 PM
peter j
external usenet poster
 
Posts: n/a
Default Update query

I am a novice at Access: I have an update query that uses two parameters,
which I get the user to supply using a PARAMETERS statement at the start of
the query. The value from one of these has to be obtained by running another
query (which does a SUM function, so it returns a single row with a single
column, ie just one value) , and this seems a bit naff. The final SQL would
look at bit like:
UPDATE myTable SET field1=[User value], field2=(SELECT SUM(field3) FROM
myOtherTable) WHERE ...
but this does not work with the embedded query. Can I use the anything in
Access to automate this? (Oh, and I still use Access97: it does the job, so
we haven't upgraded to anything more modern)
  #2  
Old April 11th, 2005, 07:12 PM
Steve Schapel
external usenet poster
 
Posts: n/a
Default

Peter,

There are more than one approach to this. One way is...
UPDATE myTable SET field1=[User value],
field2=DSum("[field3]","myOtherTable")

--
Steve Schapel, Microsoft Access MVP


peter j wrote:
I am a novice at Access: I have an update query that uses two parameters,
which I get the user to supply using a PARAMETERS statement at the start of
the query. The value from one of these has to be obtained by running another
query (which does a SUM function, so it returns a single row with a single
column, ie just one value) , and this seems a bit naff. The final SQL would
look at bit like:
UPDATE myTable SET field1=[User value], field2=(SELECT SUM(field3) FROM
myOtherTable) WHERE ...
but this does not work with the embedded query. Can I use the anything in
Access to automate this? (Oh, and I still use Access97: it does the job, so
we haven't upgraded to anything more modern)

 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Update Query Not Working From ADO Barry-Jon Running & Setting Up Queries 3 March 18th, 2005 08:42 PM
Update query to resequence MSROOKIE Running & Setting Up Queries 2 March 7th, 2005 01:11 PM
Update Query including a Union Query Vincdc Running & Setting Up Queries 2 February 28th, 2005 09:17 PM
Help ASAP: Update and Calculation query not working DDTrx2004 General Discussion 2 November 27th, 2004 12:29 AM
Update query by 1/2 entered number Eb1mom Running & Setting Up Queries 2 July 9th, 2004 02:07 AM


All times are GMT +1. The time now is 04:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.