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 |
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2009-09-22 : 05:00:59
|
| Hi,Ive got a table of transactions, any ideas/instructions on how to write logic to show only those records for the current week in the year?Cipriani |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-22 : 05:03:18
|
| General waywhere datecol>=dateadd(week,-1,getdate())If it doesn't give the data you want, define what current is forMadhivananFailing to plan is Planning to fail |
 |
|
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2009-09-22 : 05:09:27
|
Hi Thanks for your prompt reply, Ive just run your query and it is giving me records from the 16th last week.Anyway of giving from current monday to sunday etc?Thanks#quote: Originally posted by madhivanan General waywhere datecol>=dateadd(week,-1,getdate())If it doesn't give the data you want, define what current is forMadhivananFailing to plan is Planning to fail
|
 |
|
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2009-09-22 : 05:15:59
|
Sorry ignore the last post, thats great thanks!quote: Originally posted by madhivanan General waywhere datecol>=dateadd(week,-1,getdate())If it doesn't give the data you want, define what current is forMadhivananFailing to plan is Planning to fail
|
 |
|
|
|
|
|
|
|