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 |
rookie_sql
Constraint Violating Yak Guru
443 Posts |
Posted - 2007-06-22 : 04:34:44
|
Hi i have a view were i need to resteict the amount of data thats displayed in a report. i group all my data together because i have about 600,000 rows of data in the view i need a way of not showing the pervious 2days of data, but i also need to display data from 2007 on wards |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-22 : 08:52:23
|
So, in 2007 you want to show all data except last days?MadhivananFailing to plan is Planning to fail |
 |
|
rookie_sql
Constraint Violating Yak Guru
443 Posts |
Posted - 2007-06-22 : 10:25:36
|
I want to show all the data from 01-01-07 to getdate() -2 daysSo my report will show all the data for 2007 apart up to -2 days.for today i like to see data up to 20th of june tomorrow up to the 21th etc.. |
 |
|
pamit_1982
Starting Member
13 Posts |
Posted - 2007-06-22 : 10:37:11
|
Consider datecreated as column..use datediff.. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-22 : 11:21:26
|
Create view yourview asSelect columns from tablewhere datecol<dateadd(day,datediff(day,0,getdate()),-1)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|