I have a query which filters through a table for items with a specific insertion date. The date is of timestamp format.
When I used the following comparison in the query, it works fine:
created > DATEADD(DAY,-5, CAST(GETDATE() AS DATE)
But when I parametrize the query as below:
created > :tomorrow
where tomorrow defined as below:
$tomorrow = new \DateTime( 'tomorrow' );
$tomorrow->setTime( 0, 0, 0 );
$tomorrow = $tomorrow->format( 'Y-m-d');
Then it doesn't work. Does it have anything to do with the format of the tomorrow date?