Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Hi all, I need some help figuring out this problem. I have a table that has DateTime field. I want to include in my basic query some code that will pull the "previous" inputted rows by the last Date. There will be multiple rows too. Soo.. there would be say... 5 rows with a 1/12/05 date then 7 rows with a 1/11/05 date, and so on. How in the world can I just get those 5 rows with the 1/12/05 date WITHOUT having the user input a Date parameter????
X002548
Not Just a Number
15586 Posts
Posted - 2005-01-18 : 16:24:50
I don't get it...you want the last date? What about tomorrow?"Tomorow may come.....it usually does"** JBBrett8-)
hueby
Posting Yak Master
127 Posts
Posted - 2005-01-18 : 16:31:14
Yah, I just want the group of rows with the latest Date. BUT without having the user enter a date parameter. So the query would figure out the latest entered Date, and pull all the rows (which would be changing) with that Date. That make any more sense? :/
MichaelP
Jedi Yak
2489 Posts
Posted - 2005-01-18 : 17:03:33
Post some sample data and expected results please.I'm thinking you are looking for something with some DATEADD() magic in it.Lookup DateAdd() in Books On-line.Michael<Yoda>Use the Search page you must. Find the answer you will.</Yoda>