Mistake in statement's syntax

Database

Mistake in statement's syntax

Hi,
there are birthdays saved in a table as integer value.
Now I'd like to format every date in case its value is greater than 0.
The following statement doesn't work correctly and I don't know why.
SELECT cust_no, 
CASE WHEN birthday > 0
THEN birthday (DATE, FORMAT 'DD.MM.YY')
ELSE birthday
END
FROM myTable

Error Message: Expected something like an 'END' keyword between the word birthday and '('.

Could anybody correct the mistake?

Thanks in advance
Jan
2 REPLIES

Re: Mistake in statement's syntax

You could try something like below:

SELECT CASE WHEN 1070618 > 0 THEN cast(1070618 as DATE format 'dd-mm-yy') ELSE null end

The above statement would return:

*** Query completed. One row found. One column returned.
*** Total elapsed time was 1 second.


------------------
2007-06-18

Re: Mistake in statement's syntax

Thanks a lot.
It works very well.