Hello,
I'm trying to do something that I was sure it is simple, but...
I have a DB Multi Record Loader on submit event. I have also some date fields in the form for filtering the query by date. I want to query my records using these date fields like:
With this in where statement I have empty results. But with this
I have the November data.
So the question is "how can I use the form fields in a where statement" after a user submiting the form?
Thank you in advance.
Takis
I'm trying to do something that I was sure it is simple, but...
I have a DB Multi Record Loader on submit event. I have also some date fields in the form for filtering the query by date. I want to query my records using these date fields like:
createdtime between <?php echo $form->data['input_datefrom']; ?> and
<?php echo $form->data['input_dateto']; ?>
With this in where statement I have empty results. But with this
createdtime between '2012-11-01' and
'2012-11-30'
I have the November data.
So the question is "how can I use the form fields in a where statement" after a user submiting the form?
Thank you in advance.
Takis
Hi Takis,
In the PHP example you've left out the quotes round the date strings so it should be more like this
Bob
In the PHP example you've left out the quotes round the date strings so it should be more like this
`createdtime` BETWEEN '<?php echo $form->data['input_datefrom']; ?>' AND '<?php echo $form->data['input_dateto']; ?>'
but I think you can also use the curly brackets syntax there`createdtime` BETWEEN '{input_datefrom}' AND '{input_dateto}'
Bob
This topic is locked and no more replies can be posted.