Add column for yyyy-mm-dd
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a set of data that I would like to add a column with date format YYYY-MM-DD as shown below. Looking at columns A and B to determine the month and year. Ideas?
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@traceystone
I can think of two ways
1. Use the DateTimeParse function to convert the string 'yyyy-mm' in to Date format data
2. Use the DateTime tool to parse the string 'yyyy-mm' in to Date format data
of course, the Year and month in your date look like integer, we need first convert them to String.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The target is "yyyy-mm-01", the first.
yyyy comes from [a]
- comes from "-"
mm comes from padleft([b], 2, "0")
-01 comes from "-01"
put it all together:
[a]+"-" + padleft([b],2,"0") + "-01"
If a or b are not strings, put a select in front of the formula tool and switch them.
that's how I might solve the challenge.
cheers,
mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I get nulls both ways. Says that YearMonth is not a valid date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can you check the date type of YearMonth, it should be String Type, rather then Date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Well how bout that.. I missed that field when I added the formula. Thank you..
