Desktop productivity for business analysts and programmers

Which Date function can be used to extract month(Character) from teradata column value ?

Reply
SAS Employee
Posts: 4

Which Date function can be used to extract month(Character) from teradata column value ?

Hi all,

Can anyone suggest me how to or which function can be used to extract month from a date value in Teradata.

Ex: November from 25/11/2010(dd/mm/yy) date value.

Valued Guide
Posts: 854

Re: Which Date function can be used to extract month(Character) from teradata column value ?

Here you go:

data have;

infile cards dsd;

informat date_value ddmmyy10.;

format date_value ddmmyy10.;

input date_value;

cards;

25/11/2010

;

run;

data want;

set have;

/*numeric*/

month1 = month(date_value);

/*Character*/

month2 = substr(put(date_value,ddmmyy10.),4,2);

run;

Ask a Question
Discussion stats
  • 1 reply
  • 1893 views
  • 0 likes
  • 2 in conversation