Forum Discussion
Error When Running The Code: Incorrect syntax near the keyword 'CASE'
- 1 year ago
Good to hear that your problem is solved!
Just add a comma behind the * and the quety will give you all the columns in the table.
Try this:
SELECT gbkmut.reknr, gbkmut.bdr_hfl,
CASE WHEN gbkmut.transtype IN ('N','C','P','F') AND gbkmut.transsubtype NOT IN ('R','S') AND gbkmut.bdr_hfl >= 0 OR gbkmut.transsubtype IN ('R','S') AND gbkmut.bdr_hfl < 0
THEN gbkmut.bdr_hfl
ELSE NULL END AS Debit,
CASE WHEN gbkmut.transtype IN ('N','C','P','F') AND gbkmut.transsubtype NOT IN ('R','S') AND gbkmut.bdr_hfl >= 0 OR gbkmut.transsubtype IN ('R','S') AND gbkmut.bdr_hfl < 0
THEN NULL ELSE -gbkmut.bdr_hfl END AS Credit
FROM gbkmut
What I did:
* I added a comma behind gbkmut.bdr_hfl
* I removed your second select statement
* I added a from statement in which I assumed gbkmut is your table name
Hi,
It worked!
Is it possible to get the whole fields of gbkmut instead of the couple?
I used SELECT * but got the same error as shown
- Smalfly1 year agoResponsive Resident
Good to hear that your problem is solved!
Just add a comma behind the * and the quety will give you all the columns in the table.