Viewing 15 posts - 38,431 through 38,445 (of 59,072 total)
dmoldovan (5/11/2010)
I think that a cursor, which accesses the data ordered by date, is useful in your case.
So... let's see the cursor. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 9:03 pm
Also, didn't eric_russell's code do it for you?
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 8:49 pm
koustav_1982 (5/11/2010)
I have a complex query.
Now this query can be written as
1. A view
2. A stored Procedure
Assume that the query do not accept any parameter .
Which one should...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 8:41 pm
Heh... you do realize that by using the 2008 VALUES clause, that all of the people still stuck in the world of 2005 or earlier either can't help you or...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 8:30 pm
Yes... Self Joined CTE with ROW_NUMBER() so you can join the rows with an offset of 1. Since you're brand new, you might want to take a look at...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 8:17 pm
Robb Melancon (5/11/2010)
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 8:11 pm
simflex-897410 (5/11/2010)
I have fixed them up and have been able to generate data.
Please see entire scripts from Createtable, to insert, to query.
If (OBJECT_ID('dbo.HHSDataTest', 'Table') Is Not...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 8:06 pm
The problems are many here. You're simply trying to do too much in a single GROUP BY which is why you have to duplicate so much of the SELECT...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 7:53 pm
shjaffer (5/11/2010)
I have this query that I want it to give me data for the 12 months.
Thanks for the sample data but... WHICH 12 months? Current Calendar year...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 7:45 pm
Robb Melancon (5/11/2010)
basically each row has to be compared to the previous row in order to do some calculations to get a daily "performance" of Assets/Accounts by some grouping
Unless the...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 7:27 pm
rfranklin-741429 (5/11/2010)
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 7:19 pm
bitbucket-25253 (5/11/2010)
Last but not least, I currently only have SQL Server 2000 and 2005 installed. I indicate which rev each section of code will run on in parenthesis
Emphasis...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 7:18 pm
Magoo... here's what I'm talking about... if I take out the partitioning that supports the dupe check, then you probably get more like what you're expecting...
WITH
cteFirstGen AS
( --=== Gen enough...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 6:35 pm
mister.magoo (5/11/2010)
The first ten codes in the sample I tried...
10000180
10000F52
10001875
10001D17
1000221F
10003478
100035E7
10003763
10006415
100081B2
Is there some bias towards groups of characters in that solution ....
Or am...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 6:26 pm
scziege (5/11/2010)
Absolutly Great job
I love a satisfied customer. Thanks for the feedback. Most folks on this thread had the right idea to begin with...
Now... a favor from...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2010 at 2:47 pm
Viewing 15 posts - 38,431 through 38,445 (of 59,072 total)