Quantcast
Channel: Rounding SQL DateTime to midnight - Stack Overflow
Viewing all articles
Browse latest Browse all 12

Rounding SQL DateTime to midnight

$
0
0

I am having a small problem with my SQL query. I'm using the GETDATE function, however, let's say I execute the script at 5PM, it will pull up records between 12/12/2011 5PM to 12/18/2011 5PM. How can I make it pull up records for the whole entire 12/12/2011 - 12/18/2011 basically ignore time.

My script:

WHERE Orders.OrderStatus = 'Shipped'AND Orders.ShipDate > (GETDATE()-6)  

Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images