Get day/month name

There is an answerbook on EpicWeb I found handy for starting out if you have access to it.

Title is something like this: BAQ General Information on Calculated fields


Here is a section with a Month/Year example:

Create a MonthYear field. 

Note: for
this example you must set the data type to Character
and the format to X(7).

       
        string(Month(OrderHed.OrderDate),
“99”) + “-” + string(Year(OrderHed.OrderDate),
“9999”)

I'm new to ABL and am writing a BAQ but can't find an easy reference for this...I'm trying to get a given date's month name and day. With SQL it'd be datename but I'm not seeing anything similar to msdn for help on this. Anyone know?
Year(field), Month(field), Day(field). In the calculated field editor these should be choices or you can hand enter them.  Progress/OpenEdge manuals are on-line.


Jim Kinneman

Encompass Solutions, Inc.

Here is the function to get the Month name.


  1. FUNCTION fn-MonthName RETURNS CHARACTER
  2.   (INPUT ip-MonthNumber AS INTEGER):
  3.   DEFINE VARIABLE lv-Months as CHARACTER NO-UNDO INITIAL "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".
  4.   IF ip-MonthNumber LT 1 OR ip-MonthNumber GT 12 THEN
  5.     RETURN "".
  6.   RETURN ENTRY(ip-MonthNumber,lv-Months).
  7. END.