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 |
|
velnias2010
Posting Yak Master
125 Posts |
Posted - 2010-11-22 : 10:07:50
|
| SELECT CONVERT(varchar, f.FixtureDate, 106) AS stringDate, DATENAME(DW, f.FixtureDate) AS DayOfWeek, f.FixtureDate, f.Meeting, f.VenueCode, f.Evening, f.BankHoliday, f.Type, f.MeetingNum, f.Cancelled, v.Content_ID, f.FestivalFROM tbHRI_Fixtures AS f INNER JOIN tbHRI_Venue AS v ON f.VenueCode = v.RA_Venue_idWHERE (DATEDIFF(Day, f.FixtureDate, GETDATE()) < 7)ORDER BY f.FixtureDate, f.Festival DESC, f.MeetingIm looking to tweek this line (DATEDIFF(Day, f.FixtureDate, GETDATE()) < 7)To get items from today + 7 days I.e all items whose date is range of this week |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-11-24 : 09:29:24
|
may be this?WHERE (DATEDIFF(Day, f.FixtureDate, GETDATE()+7) < 7) ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-11-26 : 03:10:25
|
| where f.FixtureDate>=dateadd(day,datediff(day,0,getdate()),0) and f.FixtureDate<dateadd(day,datediff(day,0,getdate())+7,0)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|