How can I query a date range using the values in the entry_date column of exp_channel_titles?
I’m using POST variables output as 2011-03-31 to get the ranges which is why I can’t work it out, I need to convert those dates to something like 1295534112
{exp:query sql="SELECT * FROM exp_channel_data LEFT JOIN exp_channel_titles ON exp_channel_data.entry_id=exp_channel_titles.entry_id WHERE exp_channel_data.channel_id ='7' AND exp_channel_titles.author_id = '{embed:author}' ORDER BY entry_date DESC "}
<tr>
<?php if ($col1){ echo '<td>{title}</td>'; } ?>
<?php if ($col2){ echo '<td>{year}/{month}/{day}</td>';} ?>
<?php if ($col3){ echo '<td>{field_id_85}</td>'; } ?>
<?php if ($col4){ echo '<td>{field_id_95}</td>'; } ?>
<?php if ($col5){ echo '<td></td>'; } ?>
<?php if ($col6){ echo '<td>£{field_id_51}</td>'; } ?><?php $total += {field_id_51};?>
<?php if ($col7){ echo '<td>£{exp:simple_math calculate="{field_id_51} * 0.2"}</td>'; } ?><?php $ncc += {exp:simple_math calculate="{field_id_51} * 0.2"};?>
<?php if ($col8){ echo '<td>£{exp:simple_math calculate="{field_id_51} * 0.8"}</td>'; } ?><?php $net += {exp:simple_math calculate="{field_id_51} * 0.8"};?>
<?php if ($col9){ echo '<td>£{exp:simple_math calculate="{field_id_51} * 0.2"}</td>'; } ?><?php $ncc += {exp:simple_math calculate="{field_id_51} * 0.2"};?>
</tr>
{/exp:query}
Thanks in advance!
James