Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Converting a date to text

Do anybody know if there is an expresion that will convert a date to text? For instance Jan-2013 to Jan?

4 Replies
Not applicable
Author

Hi,

if your field value is 'Jan-2013' you can use the Left() function.

Left(Field,3)

Hope it helps

Regards

Giampiero

Not applicable
Author

suppose your date field from where you get Month Year as Jan-13 is Date then create a field MonthNumber in ur script;

num(Month(Date)) as MonthNumber

Now u can create an inline table in ur script:

Load * Inline

[

MonthNumber,MonthName

1,Jan

2,Feb

3,Mar

4,Apr

5,May

.

.

.

.

12,Dec

];

jagan
Luminary Alumni
Luminary Alumni

Hi,

Left('Jan-2013', 3) is the best option to get the month name.

Regards,

Jagan.

hic
Former Employee
Former Employee

Using Left() will work, but you will not be able to sort the months properly. Use the following instead:

Month(Date#(DateField,'MMM-YYYY'))

HIC