Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Weekly report

Author  Topic 

shajimanjeri
Posting Yak Master

179 Posts

Posted - 2010-01-25 : 06:32:44
Hi,

I have two field in a table named DELIVERYDATE as datetime data type and item as varchar data type.
Which contains 1000 of records. I need to order all these records
week base. Means in the first week of this month how many items delivered like this etc


Shaji

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-25 : 06:35:32
[code]select dateadd(wk,datediff(wk,0,getdate()),0),sum(items)
from table
group by dateadd(wk,datediff(wk,0,getdate()),0)
[/code]
Go to Top of Page

shajimanjeri
Posting Yak Master

179 Posts

Posted - 2010-01-25 : 07:10:07
Thanks. Its fine
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-25 : 07:26:03
welcome
Go to Top of Page
   

- Advertisement -