CASE can only return one datatype so you will either have to cast everything to varchar(13) or use NULL for No Valid Date.
ps Instead of typing out '1900-01-01 00:00:00.000' everywhare you can just use '1900'.
May 4, 2022 at 3:56 pm
First of all, you didn't actually post the error you're getting.
Second, what are the datatypes for all of the columns involved"? That's actually super important to know here.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 4, 2022 at 10:39 pm
@KenMckelvey thank you. I was resolving it with random integer and your post have given given better response I am after.
@jeff Modem the Error is in the smaller code block, when you drag to the right 'NO Valid Acceptance Date' to data type int' and data types I pass are DateTime. Sorry really, I tried to edit and remove but I think late in the night I failed. I will edit that now again.
Also learned that CASE custom column has the same data type as the elements which it is processing.
Viewing 3 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply