Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
How do i convert this string value:
16/01/2011 12:13:52
into a date?
The goal is to be able to have Year, month, and Year/Month values.
first, format it as a proper timestamp:
timestamp#(FIELDNAME, 'DD/MM/YYYY hh:mm:ss')
Then you can apply any date functions on it, like year() for example:
year(timestamp#(FIELDNAME, 'DD/MM/YYYY hh:mm:ss')) as Year
first, format it as a proper timestamp:
timestamp#(FIELDNAME, 'DD/MM/YYYY hh:mm:ss')
Then you can apply any date functions on it, like year() for example:
year(timestamp#(FIELDNAME, 'DD/MM/YYYY hh:mm:ss')) as Year
Thanks Johannes, it worked
Is there any way i can get a month/year format?
Eg. Jan-2012
Sure is.
Instead of Year() use, MonthStart() and then add a Date() around the Monthstart function and format the string with just the month and year, 'MMM-YYYY'.