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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

A SQL problem



 
 
Thread Tools Display Modes
  #1  
Old March 5th, 2010, 07:53 PM posted to microsoft.public.access
ericb
external usenet poster
 
Posts: 76
Default 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  
Old March 5th, 2010, 08:04 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old March 5th, 2010, 08:12 PM posted to microsoft.public.access
Sharkbyte
external usenet poster
 
Posts: 110
Default 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  
Old March 5th, 2010, 08:28 PM posted to microsoft.public.access
ericb
external usenet poster
 
Posts: 76
Default 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  
Old March 5th, 2010, 09:15 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old March 5th, 2010, 09:39 PM posted to microsoft.public.access
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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  
Old March 13th, 2010, 05:44 PM posted to microsoft.public.access
De Jager
external usenet poster
 
Posts: 393
Default 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  
Old March 20th, 2010, 11:44 PM posted to microsoft.public.access
Jana Roubalova
external usenet poster
 
Posts: 4
Default 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

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


All times are GMT +1. The time now is 10:23 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.