sort by calculated field

Happy YN

Registered User.
Local time
Today, 23:35
Joined
Jan 27, 2002
Messages
425
In a report I have a calculated control which is the difference between two numbers. Is there any way that I can sort using that control? When I refer to it in VBA in an orderby it asks for the parameter of that control since it is not an actual field. Neither can I sort by it in the sorting & grouping options again because it is not an actual field?
 
Thanx but I don't think I can do that because my control is actually the difference between a field on the report and a field on a subreport which is linked to the report. If I would be able to refer to both in one query I would do away with the subreport but I can't since sometimes the result of the query for the subreport is null and that would make the source for the main report null aswell
 
If you can't calculate it in the query, you can't sort by it since you can ONLY sort by fields in the report's recordsource. It's as simple as that.

Pat, this was invaluable a couple of nights ago, as I was trying to create a report that my boss needed! After reading this, I stopped spinning my wheels trying to sort by a calculated field that was on the report itself and eventually found a different way to make it work. Even posts that have been up for a long time can still be a big help!
 

Users who are viewing this thread

Back
Top Bottom