I need to do a query something like
It is not as simple as one might think which means ideas I have looked at vary widly.
Could someone please suggest a tidy looking way of doing this.
Not tested below version but there is a cleaner way surely
Code:
SELECT * FROM invoices WHERE date= [I]'yesterdays date'[/I]
Could someone please suggest a tidy looking way of doing this.
Not tested below version but there is a cleaner way surely
Code:
SELECT * FROM invoices WHERE date>=(CAST( FLOOR( CAST( GETDATE() AS FLOAT ) ) AS DATETIME ) -1) AND date<=(CAST( FLOOR( CAST( GETDATE() AS FLOAT ) ) AS DATETIME ))
Comment