A SQL problem

E

ericb

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.
 
J

John W. Vinson

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.
 
S

Sharkbyte

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]"
 
E

ericb

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 said:
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 said:
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.
 
J

John W. Vinson

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.
 
K

KARL DEWEY

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 said:
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 said:
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 said:
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.
 
D

De Jager

ericb said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top