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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |