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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Psedu foreach

Status
Not open for further replies.

evetselas

IS-IT--Management
Sep 13, 2006
3
FR
I have a table which, simplified, consists of assembly,part
Each assembly has many parts.
I want to run an SQL which only outputs the first example of each assembly followed by the parts in that assembly.
I know I can easily do this in a macro using a foreach loop but I am trying to make this modifiable by users with some SQL skills.
I'm blowed if I can work out how to do this. Is it possible?
 
Thanks.
I haven't got any SQL statement that can do this.
What I'm trying to get is a list like

Assem1 widget1
widget2
widget3
Assem2 widget4
widget5 or similar

but and Access SQL query I can think of outputs

Assem1 widget1
Assem1 widget2
Assem1 widget3
Assem2 widget4 etc
 
It's not easy to do that in SQL.
Why not not playing with a report ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Why not write a query of the form

SELECT assembly FROM YourTableNameHere

And then add a subdatasheet to that query to that links to the table, linking on assembly.

This would allow users to view the assembly, and drill down to a list of parts.
 



You can REPORT this using a Conditional Format -- quite easy to do in Excel and I believe it may be possible in Access.

Skip,

[glasses] [red][/red]
[tongue]
 
Thanks.
I've done it as a report for the moment.
I've not used subdatasheets, I'll look at that.
Good help, thanks to all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top