Sorting SQL

  • Thread starter Thread starter Shawn
  • Start date Start date
S

Shawn

Is there a way to write an SQL statement for a query that
prompts a user to enter the way they wnat the query
sorted? Here is what I have but it does not work....any
ideas?

SELECT Basics.[Pipe Spec], [Pipe Details].[Pipe Size], Sum
([Pipe Details].Length) AS [Total Length]
FROM Basics INNER JOIN [Pipe Details] ON Basics.ID = [Pipe
Details].ID
GROUP BY Basics.[Pipe Spec], [Pipe Details].[Pipe Size]
ORDER BY Basics.[Forms]![Form_Print Options]![Option Box],
[Pipe Details].[Pipe Size];

THX
 
Back
Top