Hi,
How can I convert date format from 'yyyy-mm-dd' to 'yyyymmdd' format ? Which is the date function to be used.Please let me know.
Thanks
**Note: Subject changed to be more descriptive - Content Editor **
How can I remove dashes in a date format?
Moderators: chulett, rschirm, roy
Re: date conversion
[quote="Virupan"]Hi,
How can I convert date format from 'yyyy-mm-dd' to 'yyyymmdd' format ?
You can delete " - " by using EREPLACE function
EREPLACE(columnName,"-","")
Nitin Swarnkar
How can I convert date format from 'yyyy-mm-dd' to 'yyyymmdd' format ?
You can delete " - " by using EREPLACE function
EREPLACE(columnName,"-","")
Nitin Swarnkar
Re: date conversion
u can also do likeswarnkar wrote:Virupan wrote:Hi,
How can I convert date format from 'yyyy-mm-dd' to 'yyyymmdd' format ?
You can delete " - " by using EREPLACE function
EREPLACE(columnName,"-","")
Nitin Swarnkar
date[1,4]:date[6,2]:date[9,2]
Thanks,
Akarsh Kapoor
Akarsh Kapoor
Or you could use the good ol' ICONV/OCONV conversions
The second conversion code of "MCN" will strip away the spaces.
Code: Select all
OCONV(ICONV(in.date, "D-YMD"), "DYMD":@VM:"MCN")
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The most efficient way, in this particular case, is to use Convert() function to change the "-" characters to "".
Code: Select all
Convert("-", "", InLink.TheDate)
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.