Hello Guys,
I have a query which looks like this:
I thought that this would count the number of sale orders placed in the past week. With Monday being the first day of the week, and Sunday being the last.
However, on a Sunday, it reads 0 all day, regardless of how many orders have been placed in the week leading up, or even on the Sunday itself. The count only appears to work Monday through Saturday.
Can anyone shed any light on this?
Thanks,
Robert
I have a query which looks like this:
Code:
Select COUNT(SaleOrder_ID) AS ThisWeekCount
From SaleOrder
Where Placed IS NOT NULL
And Placed >= DateAdd(Week, DateDiff(Week, 0, GetDate()), 0)
I thought that this would count the number of sale orders placed in the past week. With Monday being the first day of the week, and Sunday being the last.
However, on a Sunday, it reads 0 all day, regardless of how many orders have been placed in the week leading up, or even on the Sunday itself. The count only appears to work Monday through Saturday.
Can anyone shed any light on this?
Thanks,
Robert