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.
| Author |
Topic |
|
real_pearl
Posting Yak Master
106 Posts |
Posted - 2004-06-21 : 01:49:36
|
| If I have to display data day wise what query should I write supposeI have data Program_ID, Program_Name, Finish_Date1 A 01-04-20042 B 01-04-20043 C 02-04-20044 D 03-04-20045 E 06-04-2004Now I want to display data asDay Program_ID Program_Name1 1 A1 2 B2 3 C3 4 D6 5 E |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-06-21 : 01:51:50
|
| SELECT Day(Finish_Date), Program_ID, Program_NameFROM Table |
 |
|
|
real_pearl
Posting Yak Master
106 Posts |
Posted - 2004-06-21 : 02:09:41
|
| IF I have to do the same task for week wise and fall each date in its proper week, what I may do. Please tell me. |
 |
|
|
real_pearl
Posting Yak Master
106 Posts |
Posted - 2004-06-21 : 02:09:55
|
| IF I have to do the same task for week wise and fall each date in its proper week, what I may do. Please tell me. |
 |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-06-21 : 02:45:19
|
| Check out Books Online for the DatePart function.There is a function to return the week number - DatePart(ww, <date>), but this returns the week number from the start of the year, not the month. You could possibly use something like Floor(Day(Finish_Date) / 7), but this may not give you exactly what you need.And please don't post the same question multiple times..... |
 |
|
|
|
|
|