Returning Top Ten in Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report based on a query of defects by part types. I would like to
limit the report to the top ten defective parts. Can you help me with this?
Thanks.
 
In the report control source define the amount of line you want to be
displayed in the report using TOP

Select TOP 10 TableName.* From TableName Order By [FieldName]

The order by need to be on the field that indicate which are the top parts
==============================
If you want the Top 10 parts for each group of parts (part type), use
something like

Select T1.* TableName As T1 Where T1.[PartNumber] In (Select Top 10
T2.[PartNumber] From TableName As T2 Where T2.[PartType] = T1.[PartType]
Order By [FieldName])

If you need help with the SQL, please provide me with the TableName,
PartNumber field name, group of part field name, the field to create the
order by name
 
I understand the SQL stuff okay however I can't find the report control
source or at least I don't know what I'm looking at. Thanks for the help.

Ofer Cohen said:
In the report control source define the amount of line you want to be
displayed in the report using TOP

Select TOP 10 TableName.* From TableName Order By [FieldName]

The order by need to be on the field that indicate which are the top parts
==============================
If you want the Top 10 parts for each group of parts (part type), use
something like

Select T1.* TableName As T1 Where T1.[PartNumber] In (Select Top 10
T2.[PartNumber] From TableName As T2 Where T2.[PartType] = T1.[PartType]
Order By [FieldName])

If you need help with the SQL, please provide me with the TableName,
PartNumber field name, group of part field name, the field to create the
order by name
--
Good Luck
BS"D


joshroberts said:
I have a report based on a query of defects by part types. I would like to
limit the report to the top ten defective parts. Can you help me with this?
Thanks.
 
Sorry, my mistake, it should be the Record Source of the report and not the
control source

--
Good Luck
BS"D


joshroberts said:
I understand the SQL stuff okay however I can't find the report control
source or at least I don't know what I'm looking at. Thanks for the help.

Ofer Cohen said:
In the report control source define the amount of line you want to be
displayed in the report using TOP

Select TOP 10 TableName.* From TableName Order By [FieldName]

The order by need to be on the field that indicate which are the top parts
==============================
If you want the Top 10 parts for each group of parts (part type), use
something like

Select T1.* TableName As T1 Where T1.[PartNumber] In (Select Top 10
T2.[PartNumber] From TableName As T2 Where T2.[PartType] = T1.[PartType]
Order By [FieldName])

If you need help with the SQL, please provide me with the TableName,
PartNumber field name, group of part field name, the field to create the
order by name
--
Good Luck
BS"D


joshroberts said:
I have a report based on a query of defects by part types. I would like to
limit the report to the top ten defective parts. Can you help me with this?
Thanks.
 
Back
Top