Hi, please any help with codding this.
I want do this request in php.
"SELECT * FROM movgral WHERE cta = '999.1' AND fecha >= STR_TO_DATE('01-05-2020','%d-%m-%Y' ) AND fecha <= STR_TO_DATE('31-05-2020','%d-%m-%Y' )";
This sintax work in xampp editor, but when I write in my program doesn't.
$resultados = mysqli_query($conexion,"SELECT * FROM movgral WHERE cta = '999.1' AND fecha >= STR_TO_DATE( '01-05-2020', '%d-%m-%Y') AND fecha <= STR_TO_DATE('31-05-2020','%d-%m-%Y' )" ;
$fecha1 is a date, $fecha2 is a date, $cta is a string.
Thank you.
Best regards.
SQL
How to do this in my app. MySql
-
- Posts: 392
- Joined: Wed Jul 31, 2013 1:14 pm
- Location: Maldonado - Uruguay
- Contact:
How to do this in my app. MySql
Dario Fernandez
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
Re: How to do this in my app. MySql
Please Try it,
SELECT * FROM movgral WHERE cta = '999.1' AND fecha >= '2020-05-01' AND fecha <= '2020-05-31'
SELECT * FROM movgral WHERE cta = '999.1' AND fecha >= '2020-05-01' AND fecha <= '2020-05-31'