Page 1 of 1

How to do this in my app. MySql

Posted: Tue Oct 06, 2020 12:20 am
by D.Fernandez
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 :x :x

Re: How to do this in my app. MySql

Posted: Tue Oct 06, 2020 10:55 am
by vilian
Please Try it,

SELECT * FROM movgral WHERE cta = '999.1' AND fecha >= '2020-05-01' AND fecha <= '2020-05-31'