Viewing 15 posts - 3,001 through 3,015 (of 4,080 total)
You're very welcome, Dizzy.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 21, 2009 at 10:07 am
Here you go. Cast/Convert the float data to dataype money
then the outer CONVERT will insert the commas for you.
declare @test-2 float
set @test-2 = 7265342.12
select @test-2, convert(varchar(20),cast(@test as...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 21, 2009 at 9:55 am
I wouldn't worry about PIVOT. A little "crosstab" application will handle this and run very quickly for you. Please let me know if you have any questions.
select...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 21, 2009 at 9:43 am
Absolutely. I've read pretty much all of his stuff, from Zodiac to Anathem.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 21, 2009 at 9:17 am
That's fascinating, Steve. 🙂 The closing reference to Internet services makes me wonder if any of them read Neal Stevenson's Cryptonomicron.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 21, 2009 at 9:08 am
You're a cruel man, Jeff. I'm also on pins and needles. Is he going to post it in the tally thread, or do we have...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 21, 2009 at 8:11 am
Yeah, but I want all the business for myself 😉
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 21, 2009 at 8:08 am
You're very welcome.
Besides the link to the article Jeff Moden wrote, there is another article out there by Lynn Pettis which concerns running totals over partitioned tables....
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 21, 2009 at 8:07 am
This just looks like a variation of a running totals problem.
Take a look at this; I believe it can be adapted to your purposes.
If running total equals...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 20, 2009 at 4:52 pm
I see where you're headed. One thing you should be aware of is that SQL does not dynamically create pivot tables for X number of values like Excel....
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 20, 2009 at 3:15 pm
Can I declare my independence and be a country?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 20, 2009 at 3:03 pm
If the code is going to have to run under SQL 2000, then FOR XML isn't an option. At least you have a solution which is satisfactory for...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 20, 2009 at 10:48 am
The while loop (for only 10-20 tables on average) serves to serialize the processing. In our case, the processing is identical, which is why we used a loop...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 20, 2009 at 10:45 am
There must be a typo somewhere. That query is valid for 2005. Could you cut and paste your code back here, along with the error?
Putting the comma...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 20, 2009 at 8:58 am
Glad you found a solution. Good luck.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 20, 2009 at 8:29 am
Viewing 15 posts - 3,001 through 3,015 (of 4,080 total)