Tom Whiteside
July 22nd, 2002, 10:04 PM
You can change your Windows - Control Panel - Regional Settings - Date - Long Date Style setting from it’s relatively useless day-of-the-week default setting to MMM-yyyy. This will allow you to use a calculated Monarch field for "Month" to full advantage, namely, as "Jul-2002," or, "Aug-2002," and have it sort as would a real date, in proper calendar order.
Where I wish a real month field of "Jul-2002" (not a text field of "JUL-2002") and the only dates in my report are text fields of "07-JUL-02" or "14-JUL-02," using the calculated field of:
Month=Ctod("01-"+Substr([Txt_Date],4,6))
works by stripping off the "07-" or the "14-" and replacing them with "01-" and then using CTOD to transform the new text date field of “01-JUL-02” to a true date of “01-Jul-02” and display it as “Jul-2002.”. Again, you must have a Windows/Monarch date setting option of "MMM-yyyy" to make the "01/07/02" display as "Jul-2002."
So, in brief:
1) Changing the Windows Long Date Setting to MMM-yyyy will let you sort and group your text report data by calculated month fields of "Apr-2002," "May-2002," "Jun-2002," and so on, using calculated dates of 4/1/02, 5/1/02, or 6/1/02.
2) Simply using the Windows Long Date Setting of MMM-yyyy to format regular dates (4/21/02, 5/17/02, 6/8/02) will give apparent month fields of "Apr-2002," "May-2002," "Jun-2002," and so on, but they will still sort as if they were individual dates. Seventeen different dates in April will produce seventeen identically formatted fields of "Apr-2002," but they will sort and group as seventeen different entries.
Be sure to set your Monarch Field Properties to Format: Date – long, to let Monarch make use of the changed Windows Long Date Style setting.
Where I wish a real month field of "Jul-2002" (not a text field of "JUL-2002") and the only dates in my report are text fields of "07-JUL-02" or "14-JUL-02," using the calculated field of:
Month=Ctod("01-"+Substr([Txt_Date],4,6))
works by stripping off the "07-" or the "14-" and replacing them with "01-" and then using CTOD to transform the new text date field of “01-JUL-02” to a true date of “01-Jul-02” and display it as “Jul-2002.”. Again, you must have a Windows/Monarch date setting option of "MMM-yyyy" to make the "01/07/02" display as "Jul-2002."
So, in brief:
1) Changing the Windows Long Date Setting to MMM-yyyy will let you sort and group your text report data by calculated month fields of "Apr-2002," "May-2002," "Jun-2002," and so on, using calculated dates of 4/1/02, 5/1/02, or 6/1/02.
2) Simply using the Windows Long Date Setting of MMM-yyyy to format regular dates (4/21/02, 5/17/02, 6/8/02) will give apparent month fields of "Apr-2002," "May-2002," "Jun-2002," and so on, but they will still sort as if they were individual dates. Seventeen different dates in April will produce seventeen identically formatted fields of "Apr-2002," but they will sort and group as seventeen different entries.
Be sure to set your Monarch Field Properties to Format: Date – long, to let Monarch make use of the changed Windows Long Date Style setting.