Castalia does this: http://www.twodesk.com/castalia/[^] And try this one: http://www.dummzeuch.de/delphi/gexperts/english.html[^] GExprts code formatter
www.softprojects.org
Thanks to both for the replies. After some experimentation, I found that it was necessary to set the DataType for the parameter, else it did not give correct datasets for the query.