• Raja Hejamadi
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
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.
 
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.