I have a Table
ID|ProjectNr|Start|End|Name|
I want to generate an output like this:
|Name|End-Start for ID1|End-Start for ID2|
What I tried is
Select Name,
Case ProjectNr When 1 then datediff(Minute, Start, End) Else 0
From Table
I always get From
underlined with the message Incorrect Syntax near from
. Maybe I am blind but can anyone tell me what is wrong with the query please?
You forgot the word END
in the end of your CASE
statement.
Select Name,
Case ProjectNr When 1 then datediff(Minute, Start, End) Else 0 END
From Table
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments