Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to return field with multiple values 1

Status
Not open for further replies.

adrianvasile

Technical User
Apr 3, 2006
124
US
I had this problem for months now and I cannot figure it out. Basically I have a huge table that has many fields and each field has 2 - 3 values that I am interested; each account will have its account number displayed and the Salesman that will visit the account on a different day:
ACCT# SM1 SEQ1 SM2 SEQ2 SM3 SEQ3 SM4 SEQ4 SM5 SEQ4
12345 85 110 85 140

Basically this tells me that this account will be visited on day 2 (SM2) and day 4 (SM4) of the week.
I will like to be able to run a querry that will list each account every time it has a value; in this case it will look like:
12345 85 110
12345 85 140

Any ideea will be appreciated.
Thank you.
 
What will it be the table name? My access database or my AS400 system?
 
Why not access directly the AS400 data ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
No. I can't - AS400 has the data in a raw format and that is why I needed the union query the first time ( we are loosing the toughs here :)). I will need to prepare the data first using some queries (MS Access) and then use Excel
 
You may use an UNION query in the SQL view of MS-Query ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
OK. I think I figure it out. I have to use single NOT DOUBLE quotes. It works now except that it stops during the update process with "Code has been interrupted" error message.
There is some VBA code in the play so I'll check that out.
 
Be sure to set the BackgroundQuery property of the QueryTable to False.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
i did it ; it has to do with an escape key somewhere in the code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top