Buy Now
Sign in

ERRO sql

L
laurenceaa 9
July 30 2021, 13:40 #396894
Hello everyone.
When you run the query, the following error occurs.
Any tips?
Thank you
Link to erro http://laurenceaa.store/sql/erro_sql.png
GreyHead 65
August 01 2021, 08:54 #396895
Hi laurenceaa,
My guess is that this might be some difference between MariaDB and MySQL? I also notice that in the image there appears to be a ' after the %m and some double quotes in the string - but they are hard to make out in the image.
Is this a query you have written or something built in to CCv6?
Bob
If you'd like to buy me a coffee or two, thank you very much
L
laurenceaa 9
August 01 2021, 14:55 #396896
I built the query. I run it manually in phpmyadmin and get the satisfactory result.
The WHERE server clause to alert about the client's birthday.
What I noticed is that CCv6 makes character substitutions generating the error. I want to know how to make CCv6 not make these replacements.

FUNCTIONAL SQL
SELECT COUNT(`model_cliente`.`id`) AS `model_cliente.count` FROM `o493f_tpm_cliente` AS `model_cliente` WHERE DATE_FORMAT(`model_cliente`.`dt_nascimento`, '%m/%d') = DATE_FORMAT(CURDATE()-1, '%m/%d')

SQL IN ERROR
SELECT COUNT(`model_cliente`.`id`) AS `model_cliente.count` FROM `o493f_tpm_cliente` AS `model_cliente` WHERE `DATE_FORMAT(`model_cliente`.`dt_nascimento`, '%m` %D') = DATE_FORMAT(CURDATE()-1, '%M/%D') ''
teldrive 639
November 09 2021, 22:48 #397381
I had same issue, if you disable "Paging for multiple results", apply and test , if works you can after activate again paginator
may be a bug but only I detected when I used DATE_FORMAT(created , '%Y-%m-%d') in condition
Teldrive