Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Sql as access query

Author  Topic 

marleyuk
Starting Member

4 Posts

Posted - 2006-02-16 : 04:45:52
Im importing a file into access and i want to add querys. The problem is the field im querying wont always be in the same place or be the same name. The only thing that remains the same is that the field i want to query will always be the last column. Anyone know what to do for this??

Thanks
Marley.

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-02-16 : 05:09:03
Hi Marley,
Are you trying to perform a union of two queries?
If yes then name of the columns doesnt matter.
however, the datatype of columns
(at the respective positions i.e if there are 2 columns
then datatype of column1 of query1 should match datatype of column1 of query2 same with column2)
and the number of columns of both queries should match
Go to Top of Page

marleyuk
Starting Member

4 Posts

Posted - 2006-02-16 : 05:17:17
Erm not really sure i understand. I'll explain the system.


-I have a form with a command button,

-Once clicked the form opens a dialogue window prompting the user to select a file,

-Once the file is chosen it is automatically imported into a table,

-I want to run 7 querys on the data in this table,

-I want the output as a summary and to be saved as a .txt file


The real problem is that with each import the amount of rows and columns will change.. the file been imported shows the data from different nodes so depending on how many nodes are tested the amount of data will change.
Go to Top of Page

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-02-16 : 05:33:26
Everytime you are trying to append data into the same Table
But how come columns will change?? Not Clear
quote:

The real problem is that with each import the amount of rows and columns will change.. the file been imported shows the data from different nodes so depending on how many nodes are tested the amount of data will change.

Go to Top of Page

marleyuk
Starting Member

4 Posts

Posted - 2006-02-16 : 05:41:05
There are 2 columns that remain the same "Time" and "Seconds" then the other columns are Nodes. So depending on the name of the node i test the column will change. Also depending on the amount of nodes i test the amount of columns imported will change.

Example - import file 1

Time | Seconds | Suhddsd2342 | safsa121 | sdgsd9232
12/01/06 | 3060 | 0 | 0 | 0.001
12/01/06 | 1080 | 0 | 0 | 0.0023


Example - import file 2

Time | Seconds | hdhdhdhd23 | asaasas | 0sdsgsdgs
12/01/06 | 3060 | 0 | 0 | 0.00123
12/01/06 | 1080 | 0 | 0 | 0.0223
Go to Top of Page

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-02-16 : 05:47:57
Post The table structure in which you are importing the text files. And where exactly are you facing problems? While Importing or Querying?
and what you are trying to query once data is imported.
Go to Top of Page

marleyuk
Starting Member

4 Posts

Posted - 2006-02-16 : 06:03:44
Im facing problems trying to query fields that wont excist until after each import. I cant add a picture to these forums so can i email you either a zipped version of the database or a picture??
Go to Top of Page
   

- Advertisement -