Kumar Alok
Kumar Alok

Reputation: 2612

DB2: converting date values to varchar

I am new to databases, in fact this is first time.

I want to select the date column from a table and the date to be printed as an output in some given format, like is there a way i can specify the format of output of this conversion.

eg:

date: 01/01/2011

output :

Jan 1 2011

or

1st January 2011

Is there a function or way to do so? My guess is there must be?

Thanks

Upvotes: 2

Views: 18227

Answers (1)

Sparky
Sparky

Reputation: 15085

Try this:

VARCHAR_FORMAT(DATE, 'MON DD YYYY')

VARCHAR_FORMAT

Upvotes: 5

Related Questions