How to do this in my app. MySql

Post Reply
D.Fernandez
Posts: 392
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay
Contact:

How to do this in my app. MySql

Post 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
Dario Fernandez
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: How to do this in my app. MySql

Post by vilian »

Please Try it,

SELECT * FROM movgral WHERE cta = '999.1' AND fecha >= '2020-05-01' AND fecha <= '2020-05-31'
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Post Reply