Converting Character to Date Format (MM/YYYY)

2 posts / 0 new
Last post
Allyson Myers
Joined: 06/04/2021 - 09:17
Converting Character to Date Format (MM/YYYY)

I am trying to convert from Character to Date format that doesn't include the "day" information, only month and year. I have tried both changing the original column to Date and it doesn't accept the "MM/YYYY" date mask (error message: Invalid Date Mask)
I have also tried to append a new Virtual Date column using the equation @ctod(Field Name, "MM/YYYY") but instead of dates in the column, it shows "Error" in red font in each line under that column.
Thanks for any and all help!

Brian Element's picture
Brian Element
Joined: 07/11/2012 - 19:57

The date format needs a day.  Within IDEA dates are stored as YYYYMMDD.  I am not sure what you are trying to do but if you are trying to extract using only the year and month you would probably have to do something like this:

@year(DATE) = 2015  .AND. @Month(DATE) = 12

This will extract all transactions for December 2015 within the DATE field.