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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 CALENDAR TYPE OF RESULT

Author  Topic 

jonasalbert20
Constraint Violating Yak Guru

300 Posts

Posted - 2006-04-07 : 01:45:01
i have days and number of orders in a table. what i want is to get the sum of number of orders by day but in calendar format.

Please see desired result.

APRIL

SUN MON TUE WED THU FRI SAT TOTAL
-----------------------------------------------
1
2 2
2 3 4 5 6 7 8
1 1 1 2 1 1 1 8
9 10 11 12 13 14 15
0 0 0 0 0 1 0 1
16 17 18 19 20 21 22
0 0 0 0 0 0 0 0
23 24 25 26 27 28 29
0 0 0 0 0 0 0 0
30 31
0 0 0




Want Philippines to become 1st World COuntry? Go for World War 3...

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-07 : 01:49:27
on calendar date aspect you can make use of the function here. http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519

In terms of formating, you should do this in your front end application and not in t-sql.



KH


Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-07 : 01:56:58
Also refer http://sqlteam.com/forums/topic.asp?TOPIC_ID=44865

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jonasalbert20
Constraint Violating Yak Guru

300 Posts

Posted - 2006-04-07 : 02:02:05
tnx khtan.

just for reference purposes only. i just want to make it in t-sql. how should it be done?

Want Philippines to become 1st World COuntry? Go for World War 3...
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-07 : 02:02:42
you can refer to the link provided by Madhivanan



KH


Go to Top of Page

jonasalbert20
Constraint Violating Yak Guru

300 Posts

Posted - 2006-04-07 : 02:07:11
tnx madhivanan! :-D

Want Philippines to become 1st World COuntry? Go for World War 3...
Go to Top of Page

jonasalbert20
Constraint Violating Yak Guru

300 Posts

Posted - 2006-04-07 : 02:22:46
tnx also khtan.

Want Philippines to become 1st World COuntry? Go for World War 3...
Go to Top of Page
   

- Advertisement -