I need the DB Read action to get records between two dates, I am having issues making this work. Kindly help
NORMAL SQL QUERY
I need to implement the code above in array format below:
RETURN ARRAY AS REQUIRED BY DB READ ACTION
I will be very grateful
NORMAL SQL QUERY
"WHERE Payment = 1 AND id = '$a' AND Date BETWEEN '$b' AND '$c'";
I need to implement the code above in array format below:
RETURN ARRAY AS REQUIRED BY DB READ ACTION
return array(
'Payment' => 1,
'id' => $form->data['pcuser'],
'PWVTransactionDate >= ' => $form->data['pcfromactual'],
'PWVTransactionDate <= ' <= $form->data['pctoactual'],
);
?>
I will be very grateful
Hi atanunu,
The last line in the array is wrong, it should be => like the others, this is php array syntax.
The date supplied should be in the mysql format too, try this:
Best regards,
Max
The last line in the array is wrong, it should be => like the others, this is php array syntax.
The date supplied should be in the mysql format too, try this:
date("Y-m-d H:i:s", strtotime($form->data["date_field"]))
Best regards,
Max
Thanks sir, the date is formatted as required and as contained in the MySQL table.
I have attached a screen shot of the table with out conditions and my error should be properly using the
I have attached a screen shot of the table with out conditions and my error should be properly using the
BETWEEN '2005-01-01 00:00:00 AM' AND '2017-02-19 00:00:00 AM'
In the return array
Hi atanunu,
Please try
Bob
Please try
<?php
return array( ": `Payment` = 1 AND ( `PWVTransactionDate` BETWEEN '{$form->data['pcfromactual']}' AND '{$form->data['pctoactual']}' )" );
?>
Bob
This topic is locked and no more replies can be posted.