---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/troubleshooting/errors/ERR-DS_API-DB-ZERO_DIVISION
  - ru/troubleshooting/errors/ERR-DS_API-DB-ZERO_DIVISION
  - href: en/troubleshooting/errors/ERR-DS_API-DB-ZERO_DIVISION.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/troubleshooting/errors/ERR-DS_API-DB-ZERO_DIVISION.html
title: DataLens On-premises error ERR.DS_API.DB.ZERO_DIVISION
description: This page describes the Division by zero DataLens On-premises error.
vcsPath: en/troubleshooting/errors/ERR-DS_API-DB-ZERO_DIVISION.md
---

# [DataLens On-premises] Division by zero

`ERR.DS_API.DB.ZERO_DIVISION`

An error occurred when dividing by zero in a query.

The data source does not support dividing by zero.

To fix the error, check and correct the formulas.

For example, if the error was caused by this formula:
```
[A] / [B]
```

You can rewrite it as follows:

```
IF([B] != 0, [A] / [B], NULL)
```

Alternatively, you can use another numeric value instead of `NULL`, depending on the result you need.

You can also use the [DIV_SAFE](../..//function-ref/DIV_SAFE.md) and [FDIV_SAFE](../..//function-ref/FDIV_SAFE.md) functions that can handle division by zero.
