Avatar of Juan Velasquez
Juan Velasquez
Flag for United States of America

asked on 

Problem with setting report sort order at run time

Below is the sql statement that is used at runtime.  I've placed this code in a query and it sorts as it is supposed to - in this case by Task Order.  Yet when I run the report, it is not being sorted by task order.  I then went ahead and created a query using the sql statement below and made it the recordsource of the report at design time.  I still had the same problem.  I've check for any groupings or sort orders that were set in the report at design time but couldn't find any.  This is an access 2007 database
SELECT qryProject.[TaskOrder], [OBS Master].OBS, [Lname] & ', '  & [Fname] AS Name, [OBS Master].Fname, [OBS Master].Lname, qryProject.[ChargeNumber], qryProject.Posted AS WeekEnding, qryProject.Workhours AS RegularHours, [FY11B]+[FY11OH] AS FY11Rate, [RegularHours]*[FY11Rate] AS RegularPay, qryProject.Overtime AS OvertimeHours, [OT11B]+[OT11OH] AS FY11otRate, [OvertimeHours]*[FY11otRate] AS OvertimePay, [OBS Master].ODC3 AS FY11odcRate, [OBS Master].Fee2 AS FY11FeeRate,[RegularPay]+[OvertimePay] AS TotalPay, [OBS Master].FY11B, [OBS Master].FY11OH, [OBS Master].OT11B, [OBS Master].OT11OH, project.Comments, project.locked, qryProject.source, [OBS Master].[Company ] FROM (Period INNER JOIN qryProject ON Period.[Week Ending] = qryProject.Posted) INNER JOIN [OBS Master] ON qryProject.OBS = [OBS Master].OBS WHERE qryProject.locked = False AND qryProject.source Like 'a' AND [Week Ending] = #4/22/2011# AND Company = 'EC' ORDER BY TaskOrder

Open in new window

Microsoft Access

Avatar of undefined
Last Comment
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

8/22/2022 - Mon