Error: It is not possible to convert between the specified types. (State:22008, Nativ

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: Error: It is not possible to convert between the specified types. (State:22008, Nativ

Hello,

Could someone kindly help me rewrite the correct syntax to write in order to use a date and text field in a case statement. However I need to find the maximum date of the date field, so am assuming that I need to to use both to_char and to_date

case when location = 'DOSPR' then Max(TO_CHAR(TO_DATE(datetime,'YY/MM/DD'),' YY/MM/DD')) else '' end as test,