Page 1 of 1

Transport data from query to table

PostPosted: Fri Nov 06, 2015 4:42 pm
by matroSK
Hey guys.
Just one question.
Is it possible to "transport" data from query to table? That query comes from another table.
I need to filtrate this data in "query mode" and then I would like to put them in different table.

Thanks

Re: transport data from query to table

PostPosted: Fri Nov 06, 2015 5:22 pm
by F3K Total
Hi,
if all columns match, just copy the query (rightclick->copy) and paste it onto the target-table in tables area, then select in the wizzard, if not preselected, Append data/Create
R

Re: transport data from query to table

PostPosted: Wed Nov 11, 2015 12:58 am
by matroSK
thanks, but I´m looking for some way of how it would be done automatically, because this situation will happen often

Re: transport data from query to table

PostPosted: Wed Nov 11, 2015 6:29 am
by F3K Total
Yes,
also possible, by code.
R

Re: transport data from query to table

PostPosted: Fri Nov 13, 2015 11:12 am
by matroSK
And could you please suggest me how to do it, because I have no idea.

Re: transport data from query to table

PostPosted: Fri Nov 13, 2015 4:39 pm
by F3K Total
No,
because the code depends on your source query and the target table, it's column definitions and so on.
R

Re: transport data from query to table

PostPosted: Fri Nov 13, 2015 4:46 pm
by MTP
"by code" means writing an SQL statement and executing it through the Tools→SQL window. Exact SQL depends on your setup but would be something like
Code: Select all   Expand viewCollapse view
INSERT INTO "TargetTable" (SELECT "ColumnA", "ColumnB" FROM "SourceTable" WHERE "ColumnC" = "Something")

You could also write a macro if you want to execute this SQL by pushing a button instead of typing into the SQL window. Then you'd have the learning curve of the SQL language plus the learning curve of the macro language.