SQL snippets output syntax error

I'm trying to use my snippet.

SELECT
    'My Title' AS "Title",
        CONCAT(CAST(CAST(((select COUNT(*) from {{#2}} as "MyTable" WHERE {{snippet: MyFilter}} AND "GRP FOR" = 'ASD') * 100)as DECIMAL(7,2))/cast(count(*)AS DECIMAL(7,2)) as DECIMAL(7,2)), ' %')AS "ASD"
FROM {{#2}} as "MyTable"

Content of the snippet :

"EMS CREATION" >= '2022-06-01 00:00:00' AND "EMS CREATION" < '2022-07-01 00:00:00' AND "STATUS" = 'false' AND "TYPE " = 'REQ'

And when I replace the snippet by the code, it's working fine

image

Diag info :

{
  "browser-info": {
    "language": "fr-FR",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 OPR/87.0.4390.35",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "Cp1252",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "17.0.4+8",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "17.0.4",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "17.0.4+8",
    "os.name": "Windows Server 2016",
    "os.version": "10.0",
    "user.language": "fr",
    "user.timezone": "Europe/Paris"
  },
  "metabase-info": {
    "databases": [
      "h2",
      "postgres"
    ],
    "hosting-env": "unknown",
    "application-database": "mysql",
    "application-database-details": {
      "database": {
        "name": "MySQL",
        "version": "5.7.36"
      },
      "jdbc-driver": {
        "name": "MariaDB Connector/J",
        "version": "2.7.6"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2022-08-16",
      "tag": "v0.44.1",
      "branch": "release-x.44.x",
      "hash": "112f5aa"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Hi @Exe
I cannot reproduce.
Check the full stacktrace in Admin > Troubleshooting, or look in the database query log to see what it is parsing.

I have the following error :

[4d53a74f-b802-439b-8350-d713207254b9] 2022-09-08T08:33:42+02:00 WARN metabase.driver.sql-jdbc.sync.describe-table Don't know how to map column type '_int2' to a Field base_type, falling back to :type/*.

@Exe That's not an error, and completely unrelated to the problem. If no errors are shown in Metabase, which I doubt, then you'll have to check your database query log.