MS Access SQL Case Statement


One of the most important part inside the MS access SQL is the case statement. Of course, it is also useful to help people finishing their jobs. Here, the case statement’s function is to do some evaluation about lists of condition and it will return the single possibility expression in some results. There are several parts inside the MS access SQL case statement, which we will talk here. For the first matter, we will talk about the case expression.


There are two kinds of the case expression format, which people need to know. Those formats are:


  • simple case expression that will compare and consider an expression in order to determine the result of the data
  • searched case expression that will be useful to be used in evaluating a set of Boolean expression. It is also used to determine results from some data


People need to know that all formats as above is an optional of else argument.




Now, we are going to talk about the detail of SQL arguments. There are several kinds of MS Access SQL argument build the case statement up. We will talk about all five arguments below.


  • input expression is the expression that is evaluated from the simple case format when it is used. This input expression is kind of a valid expression
  • when expression is a kind of a simple expression that is compared with an input expression, especially when the simple case format is used in the formula. It is also a number of valid expression. Here, the data types of each input and when expression should be same of has an implicit conversation
  • result expression is the kind of expression returned in condition especially when the input expression is equal with the when expression. The condition happen when the input expression and when expression evaluate data with TRUE result. It is also an example of valid expression
  • else result expression is a kind of expression that will return the data when there is no compared data to be evaluated in to TRUE result. If the argument happen, the result will be back into NULL condition.
  • Boolean expression is a kind of expression that is used when people use the searched case format in evaluating the data


Return values


Now, we will move to talk about the return values inside the MS access SQL.


Simple case expression


It is used when people operate the formula by comparing the first expression in the kind of ‘when clause’. If the total expressions inside the formula are equivalent, the detail expression inside the ‘then clause’ will be returned well.


  • allow only kind of checking in quality
  • evaluating the detail of input expression and then input expression = when expression for the specified data. It will work for when clause
  • returning the result expression inside the first input expression = when expression, which show the TRUE result
  • if the equals does not show the TRUE result, SQL database engine will return in NULL value if there is no specified else clause


For more detail explanation, you can look for the detail of data type precedence.


Contact Our Professional Microsoft Access Database and Templates Developers:
Need MS Access template customization service? Click Here
-Phone or SMS +1-(786)-886-3099 (Working Hours Only). If you don't get answer by phone, you can send us whatsapp message or email
-Send message using Online Contact Form