FAQ/Divide-By-Zero.md
... ...
@@ -26,4 +26,14 @@ Usage; code for your Izenda ``global.asax``:
26 26
27 27
//To Display NULL (nothing)
28 28
(AdHocSettings.Formats.Get("DivisionByZero") as AdHoc.Formats.Formats.DivisionByZeroFormat).ReplaceText = "";
29
-```
... ...
\ No newline at end of file
0
+```
1
+
2
+###Expressions
3
+
4
+The use of expressions in a calculated field will cause the SQL server itself to throw a DIV/0 error. This is opposed to arithmetic operators, which will not cause SQL to throw exceptions. In the case of using expressions, you will have to catch possible divide by zero errors in a case statement. One example is detailed below.
5
+
6
+```sql
7
+CASE WHEN [OrderID]=0 THEN CAST(2147483647 AS float) ELSE [Freight]/[OrderID]
8
+```
9
+
10
+Using the number seen in the cast will indicate to Izenda that it should use the DIV/0 format option for that value.
... ...
\ No newline at end of file