Forum Discussion
Anonymous
6 years agoNot applicable
Shorting an Alphanumeric column
I have a column in my data base and data type of the column is varchar. Column data are like: 1 year 3 days 11 hours 2 months I want to short the data like below: 11 hours 3 days 2 MONTHS...
Anonymous
6 years agoNot applicable
Hi Anonymous
There is no easy way in which this data can be sorted as there is no datatype which can identify it. I am not saying it is impossible.
One possible and easy solution can be to create a calculated column on the WorkItem_id table created_date column and display it as one unit
Age in Months = DATEDIFF(created_date,today(), MONTH)
Alternatively you can also display it in week, day or hour
Age in Months = DATEDIFF(created_date,today(), WEEK)
Age in Months = DATEDIFF(created_date,today(), DAY)
Age in Months = DATEDIFF(created_date,today(), HOUR)
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Regards,
Pranit