Hi
I have datetime column which can be either in this format :
'21-01-2008 12:00:00' or '21-01-2008'.
I have to convert timestamp to date:
TimestampToDate function accepts only timestamp as input.
Please let me know as how to convert the same.
Thanks
TimestampTodate
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you are pulling the field from the database, just use Trunc(Field) which gives you only the date.
Pull that through the transformer without doing anything.
Or as Maveric said,
Read the data as varchar and check if the length is more than 10. If it is more than 10,
If you want to convert it back to date- use StringToDate() ![Smile :)](./images/smilies/icon_smile.gif)
Pull that through the transformer without doing anything.
Or as Maveric said,
Read the data as varchar and check if the length is more than 10. If it is more than 10,
Code: Select all
Left(Field,10)
![Smile :)](./images/smilies/icon_smile.gif)
Thanks and Regards!!
dspxlearn
dspxlearn