I have a field which shows year and month, such as 20017. When I try to sort by this field, 200111 sorts before 20017. It sorts okay in a query but not on the report. How can I make this work?
Thanks,
jnix
Somewhere along the way you have set the field as a text field, I think. You could get over the problem by referring to Jan as "01", Feb as "02" and so on.
Mikey,
SOunds like you might be using Sorting and Grouping fields within your report. Be aware if you are, that the Sorting and Grouping sort order takes presidence of any ORDER BY provided in the report's recordsource, and this is probably what is causing the sorting to appear as not working within your report.
The solution is to control the sorting from within the Sorting and Grouping fields (ie. by adding another field here, in the right position) OR removing sorting and grouping from the report, and thus letting the report's underlying recordsource query control the order.
Hope this helps. Best regards to Table Mountain,
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
Steve - not my original problem. I just commented. But your comment is a good one. As with so many of these posts, there are lotsdo f little implications
jnicks:
You can get rid of the problem if you use the leading zero of month in building the year + month.
For this, you could use Year(YourField) & Format(Month(YourField),"00"
And if you want the field to be numeric, use:
Year(YourField) *100 + Month(YourField)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.