Hi,
I have a formula where I am going to use by grouping on years between current year and the publication year and calculate the difference:
// grouping by publication years
if datediff("yyyy", cdate{DTE.DATE1}, currentdate) in [1, 2, 3, 4, 5]
then "1 - 5 Years"
else
if datediff("yyyy", cdate({DTE.DATE1}), currentdate) in [6, 7, 8, 9, 10]
then "6 - 10 Years"
else
"11 Years and over"
DTE.DATE1 is a nvarchar type string, stored as 1995, 1996, etc.
I was trying to conver DTE.DATE1 to date type, there was an error - bad string, or just using {DTE.DATE1} will not work eigher obviously as datediff needs two date type arguments.
Could somebody advise how to make it work when there is a string type field as an argument for datediff? Thanks in advance.
John