Hi,
I am new to Teradata and have a problem converting date into string.
actually date is stored as varchar in teradata ex: 07/24/1922 fromat
and i want to convert into '19220724'. Please help me...
thanks,
Venkat
Teradata date function
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Surely you can just use some combination of SUBSTRING and concatenation to produce your desired result in a SELECT statement?
In ANSI SQL this would be
In ANSI SQL this would be
Code: Select all
SELECT SUBSTRING(DATESTR FROM 7 FOR 4) || SUBSTRING(DATESTR FROM 1 FOR 2) || SUBSTRING(DATESTR FROM 4 FOR 2) FROM tablename
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia