SQL syntax for "week-to-date"

I need to find out total qty sold "week to date" on a SQL query, something like

select i.itemlookupcode, sum(quantity) from transactionentry te inner join [transaction] t on te.transactionnumber = t.transactionnumber inner join item i on te.itemid = i.id where t.time > (week to date) group by i.itemlookupcode

- - week to date being the first day of the current week - sunday

I appreciate any help I can get on this - thanks

Reply to
convoluted
Loading thread data ...

Replace this row: where t.time > (week to date) to

where time >= DATEADD(ww,DATEDIFF(ww,0,GETDATE()),0)

Reply to
Mahmoud Amin

Reply to
convoluted

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.