How to use SUBSTRING something like this:
Thank you in advance!
Hi Sir @allan, Thanks
I believe your 0 should actually be a 1. Testing it locally like that allows it to work.
0
1
See also the MySQL documentation which states:
For all forms of SUBSTRING(), the position of the first character in the string from which the substring is to be extracted is reckoned as 1.
Allan
We got it sir @allan, this one is working:
$q->and_where( 'SUBSTR(date_and_time_received,1,10)',$GLOBALS["date_now"], '=' );
It looks like you're new here. If you want to get involved, click one of these buttons!
Answers
Hi Sir @allan, Thanks
I believe your
0
should actually be a1
. Testing it locally like that allows it to work.See also the MySQL documentation which states:
Allan
We got it sir @allan, this one is working:
$q->and_where( 'SUBSTR(date_and_time_received,1,10)',$GLOBALS["date_now"], '=' );