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
|
|||
|
|||
A SQL problem
I have this querie that gets information from different tables that works
just fine, it is composed of 38 fields. Now I have TABLE-X that is composed of fields indentical to the ones in the querie. I want to transfer the info from the querie to the table. I only have 1 record to transfer but many fields. What SQL instruction should I use to transfer the data from the querie to TABLE-X. The querie goes like this : SELECT FA, FB,... FX FROM .... WHERE...; I maded an string for an UPDATE instruction but it is terribly long. Is their a better way of doing this ? Thank you. -- Eric |
#2
|
|||
|
|||
A SQL problem
On Fri, 5 Mar 2010 11:53:02 -0800, ericb wrote:
I have this querie that gets information from different tables that works just fine, it is composed of 38 fields. Now I have TABLE-X that is composed of fields indentical to the ones in the querie. I want to transfer the info from the querie to the table. I only have 1 record to transfer but many fields. What SQL instruction should I use to transfer the data from the querie to TABLE-X. The querie goes like this : SELECT FA, FB,... FX FROM .... WHERE...; I maded an string for an UPDATE instruction but it is terribly long. Is their a better way of doing this ? Thank you. Change the qeury to an Append query (using the query type tool on the toolbar) if you want to add a new record to this (redundant, misdesigned, unneeded :-{() table; if the fieldnames match, Access should link them up for you, if not just edit the right fieldname into the Append To line. If you want to *update* an existing record, you'll have to explain a bit more about the structure of TABLE-X. -- John W. Vinson [MVP] |
#3
|
|||
|
|||
A SQL problem
You could write an append query, though for 38 fields I would use Access'
query builder rather than doing it in code. Then just use DoCmd.OpenQuery "[qryname]" "ericb" wrote: I have this querie that gets information from different tables that works just fine, it is composed of 38 fields. Now I have TABLE-X that is composed of fields indentical to the ones in the querie. I want to transfer the info from the querie to the table. I only have 1 record to transfer but many fields. What SQL instruction should I use to transfer the data from the querie to TABLE-X. The querie goes like this : SELECT FA, FB,... FX FROM .... WHERE...; I maded an string for an UPDATE instruction but it is terribly long. Is their a better way of doing this ? Thank you. -- Eric |
#4
|
|||
|
|||
A SQL problem
I don't think that will cut it.
Actually what i want to do, is to put those fields in a table, store the table on file and then email the file. At the other end I will open the file and put the info back into a similar table and then process it. This is all new to me, am I doing this properly or I am barking at the wrong tree ? Thank you for the help. -- Eric "Sharkbyte" wrote: You could write an append query, though for 38 fields I would use Access' query builder rather than doing it in code. Then just use DoCmd.OpenQuery "[qryname]" "ericb" wrote: I have this querie that gets information from different tables that works just fine, it is composed of 38 fields. Now I have TABLE-X that is composed of fields indentical to the ones in the querie. I want to transfer the info from the querie to the table. I only have 1 record to transfer but many fields. What SQL instruction should I use to transfer the data from the querie to TABLE-X. The querie goes like this : SELECT FA, FB,... FX FROM .... WHERE...; I maded an string for an UPDATE instruction but it is terribly long. Is their a better way of doing this ? Thank you. -- Eric |
#5
|
|||
|
|||
A SQL problem
On Fri, 5 Mar 2010 12:28:20 -0800, ericb wrote:
I don't think that will cut it. Actually what i want to do, is to put those fields in a table, store the table on file and then email the file. At the other end I will open the file and put the info back into a similar table and then process it. This is all new to me, am I doing this properly or I am barking at the wrong tree ? Thank you for the help. A Table in Access has no independent existance outside the database. You may want to consider exporting the data to some "file" type format - comma separated values text, XML, an Excel spreadsheet, a dBase "database" - and email that; it's likely to be much smaller and more convenient than having a ..mdb file just for the purpose of transmitting data. If your version of Access supports it (I believe the capability arrived with 2003) I'd suggest XML since it preserves the structure of the data. -- John W. Vinson [MVP] |
#6
|
|||
|
|||
A SQL problem
Why not a simpler way? Run your query, click on the upper left corner,
CNTRL-C, and paster in an e-mail. The other end opens the e-mail, highlight the data, copy, open table, highlight the fields, and paste. -- Build a little, test a little. "ericb" wrote: I don't think that will cut it. Actually what i want to do, is to put those fields in a table, store the table on file and then email the file. At the other end I will open the file and put the info back into a similar table and then process it. This is all new to me, am I doing this properly or I am barking at the wrong tree ? Thank you for the help. -- Eric "Sharkbyte" wrote: You could write an append query, though for 38 fields I would use Access' query builder rather than doing it in code. Then just use DoCmd.OpenQuery "[qryname]" "ericb" wrote: I have this querie that gets information from different tables that works just fine, it is composed of 38 fields. Now I have TABLE-X that is composed of fields indentical to the ones in the querie. I want to transfer the info from the querie to the table. I only have 1 record to transfer but many fields. What SQL instruction should I use to transfer the data from the querie to TABLE-X. The querie goes like this : SELECT FA, FB,... FX FROM .... WHERE...; I maded an string for an UPDATE instruction but it is terribly long. Is their a better way of doing this ? Thank you. -- Eric |
#7
|
|||
|
|||
A SQL problem
"ericb" wrote in message ... I have this querie that gets information from different tables that works just fine, it is composed of 38 fields. Now I have TABLE-X that is composed of fields indentical to the ones in the querie. I want to transfer the info from the querie to the table. I only have 1 record to transfer but many fields. What SQL instruction should I use to transfer the data from the querie to TABLE-X. The querie goes like this : SELECT FA, FB,... FX FROM .... WHERE...; I maded an string for an UPDATE instruction but it is terribly long. Is their a better way of doing this ? Thank you. -- Eric |
#9
|
|||
|
|||
A SQL problem
"ericb" píąe v diskusním příspěvku ... I have this querie that gets information from different tables that works just fine, it is composed of 38 fields. Now I have TABLE-X that is composed of fields indentical to the ones in the querie. I want to transfer the info from the querie to the table. I only have 1 record to transfer but many fields. What SQL instruction should I use to transfer the data from the querie to TABLE-X. The querie goes like this : SELECT FA, FB,... FX FROM .... WHERE...; I maded an string for an UPDATE instruction but it is terribly long. Is their a better way of doing this ? Thank you. -- Eric |
Thread Tools | |
Display Modes | |
|
|