Needs to change DATE format

Database
Enthusiast

Needs to change DATE format

I am using V12 version I want export the data in dd/mm/yyyy format.

Expect the dates in format of :

04/20/2008

01/01/2008

I am getting result in format
4/20/2008
1/1/2008

Is there way to get results as desired format??
Tags (1)
5 REPLIES
Enthusiast

Re: Needs to change DATE format

I am using SQL Assistant
Enthusiast

Re: Needs to change DATE format

You have to format the date and cast it as character.
Not sure how you get the dates to come out of SQL Assistant like that, but the following works fine for me on TD12:

cREATE VOLATILE TABLE T1
(PK smallint not null
, dt date not null)
on commit preserve rows;

insert into t1 values (1,'2008-01-01');
insert into t1 values (2,'2008-04-20');

select PK, Cast((Dt (Format 'mm/dd/yyyy')) as Char(10))
from t1;
Enthusiast

Re: Needs to change DATE format

I am trying to export the data into mm/dd/yyyy format.
Enthusiast

Re: Needs to change DATE format

Thanks for replay, I can use it while loading the data. :-)
Enthusiast

Re: Needs to change DATE format

It will export the data into mm/dd/yyyy format.