date format problum
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


date format problum Expand / Collapse
Author
Message
Posted 10/24/2007 10:55:18 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 3/12/2008 6:18:39 AM
Posts: 13, Visits: 47
in my table



PRIME_FLIGHT_END_RANGE CHAR(4) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL DEFAULT ' ',
MIGRATION_START_DATE DATE FORMAT 'YYYY-MM-DD' NOT NULL DEFAULT DATE ,
MIGRATION_END_DATE DATE FORMAT 'YYYY-MM-DD' NOT NULL DEFAULT DATE ,
DATE_TIMEZONE_REF CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL DEFAULT ' ',
LAST_UPDATE_TSMP TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0))


INSERT INTO RAHUL_DB.DATE_TABLE

VALUES('0001',20071027,20991231,);

but when i do select option teh out put of date is as

10/27/3907 12/31/3999

1900 years is getting added to the date which i have entered

can anyone tell me the reasion and how to debug it

thank you in advance
RAHUL :)






Regards,

Rahul

Win Win

Post #9423
Posted 10/24/2007 2:32:52 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/1/2008 2:49:57 PM
Posts: 6, Visits: 44
You need to use a date constant. Try this instead:

INSERT INTO RAHUL_DB.DATE_TABLE
VALUES('0001',date '2007-10-27',date '2099-12-31',,);

Post #9428
Posted 10/24/2007 2:34:50 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 5/16/2008 4:54:37 PM
Posts: 166, Visits: 44
Rahul,

you are probably inserting the date in incorrect format.as per my understanding you want to store date '2007/10/27' into your table but you ended up inserting 3907/10/27.

your insert should have been as follows
VALUES('0001','2007/10/27','2099/12/31',....);

this would store the correct date values into your table.

Internally teradata stores the date values in integer format.Here you have attempoted to directly insert an integer into the date colunmn. Later on,When you queried the table for date column, the integer date has been converted into appropriate representation.per my understanding, when you inserted 20071027 into the table, teradata understands it as date 3907/10/27.


Leo Issac

"Wants to Learn More!"

Post #9429
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 4:14pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 8 queries. Compression Disabled.