SOLVED
Substringing a date
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Izbiz
8 - Asteroid
‎05-29-2018
01:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello!
I have a date column where the dates are given like "20110601" (year, month day)
I am going to seperate out the date parts and convert this to a date time .
However I get an issue when using a formula tool as follows:
LEFT([0CALDAY],4) + '-' + substring([0CALDAY], 5,2) +'-' + RIGHT([0CALDAY],2)
returns "2011-60-01" - so the substring function is getting rid of the lead zero. Anyone know any work arounds for this?
Thanks!
Solved! Go to Solution.
Labels:
- Labels:
- Date Time
- Parse
- Preparation
4 REPLIES 4
LordNeilLord
15 - Aurora
‎05-29-2018
02:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
ponraj
13 - Pulsar
‎05-29-2018
03:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can also use datetime tool to convert your string into date.
‎05-29-2018
08:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks - great solution!
‎05-29-2018
08:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks - good to know this
