You need to sign in to do that
Don't have an account?
Raja Hejamadi
Apex/SOQL: Sorting results by a text field containing name of the month
I have a custom object with a text field having values that represent fiscal period ids -- in the form YY-MMM. For example: 14-Jan, 14-Feb, etc.
When I query this object and order by this period id, since the field is text, it orders chronologically -- i.e., in the order 14-Apr, 14-Aug, 14-Dec, 14-Feb, etc., -- which is useless.
What would be the easiest way to achieve a sort order assuming this field represents calendar periods?
I've thought of adding another custom table to map these to month number, but couldn't figure out how to do this without a lookup relationship.
Thanks.
When I query this object and order by this period id, since the field is text, it orders chronologically -- i.e., in the order 14-Apr, 14-Aug, 14-Dec, 14-Feb, etc., -- which is useless.
What would be the easiest way to achieve a sort order assuming this field represents calendar periods?
I've thought of adding another custom table to map these to month number, but couldn't figure out how to do this without a lookup relationship.
Thanks.
Hope this helps !!!!!!
All Answers
Hope this helps !!!!!!
It will give you the integer as output