I'm trying to figure out how to incorporate a year variable I have into a casting into a date.
I want to be able to type in the month and day, but insert the year that is in the data.
Ideally, I want to do something like this, but it doesn't work as is. Any thoughts?
cast('[YEAR]-01-09',date)
Quote from: kwirth on 09 Aug 2016 03:13:24 PM
I'm trying to figure out how to incorporate a year variable I have into a casting into a date.
I want to be able to type in the month and day, but insert the year that is in the data.
Ideally, I want to do something like this, but it doesn't work as is. Any thoughts?
cast('[YEAR]-01-09',date)
cast( [YEAR] || '-01-09' , date )
cast( [YEAR] || '-' || ?SelectMonth? || '-' || ?SelectDay? , date )
Something along these lines might help although zero padding in front of the entered values might be something you have to deal with.
One other solution is to try creating this expression using functions from your database vendor, because cast() is a locally-processed function, and could possibly degrade performance.