SQL

T

Tim

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
 
M

Michel Walsh

Hi,



....
ORDER BY CHOOSE( indexParam, [Pipe Details], [Pipe Size] )



where indexParam =1 or =2.



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top