From the course: SAP Business One: Reporting and Customization

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Types in SQL

Types in SQL - SAP ERP Tutorial

From the course: SAP Business One: Reporting and Customization

Start my 1-month free trial

Types in SQL

- [Instructor] You just learned one use of the case, and I'd like you to show you one more. And an error you'll encounter often when using case. Add this around the Close Date column. So let's go to Close Date, and I'm going to do this and put CASE and then underneath that WHEN T0 Status = L THEN T0 CloseDate ELSE, and then I'll just put the string Not Closed. And then where instead of this, I'm going to put an END to end my case, and so we have this. And this is a case of using a full logical expression after the WHEN as we did with the WHERE. Often do we use it like this with one expression and then an ELSE. What this will do, is I'll print the close data if it's closed. Otherwise, instead of leaving it blank, the phrase Not Closed will be in the closed status. Now if you're going to run this, you'll find out very quickly, I'm going to hit Execute and you pick something, you get an error. And the error reads…

Contents