How to do this in my app. MySql

How to do this in my app. MySql

Postby D.Fernandez » Tue Oct 06, 2020 12:20 am

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 24.09, Harbour, MVS2022 Community, BCC, MySql & MariaDB, Dbf/Cdx VSCode.
Maldonado - Uruguay
D.Fernandez
 
Posts: 464
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay

Re: How to do this in my app. MySql

Postby vilian » Tue Oct 06, 2020 10:55 am

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
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 66 guests