Viewing 15 posts - 24,316 through 24,330 (of 59,099 total)
Ok... Here's your table with some modified data to make a couple of points.
-- DROP TABLE dbo.eqmas
go
CREATE TABLE dbo.eqmas
(eq_nmr VARCHAR(20),...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 20, 2014 at 8:38 pm
Sean Lange (2/20/2014)
Jeff Moden (2/20/2014)
Cast the final ouput as MONEY to get the leading zero.If that works then ...
Oh ye of little faith. 😛
SELECT TOP 10000
...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 20, 2014 at 6:27 pm
Dieselbf2 (2/20/2014)
hunchback (2/20/2014)
Here is an example without taking into consideration user types.
SELECT
t.name AS tn,
sc.*
FROM
sys.tables AS t
INNER JOIN
sys.columns AS sc
ON sc.object_id = t.object_id
INNER...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 20, 2014 at 12:57 pm
cms9651 (2/20/2014)
SELECT
case when ([ENER1] + [ENER2]) / 1000000 > 1 then
cast(Cast(Round(( [ENER1] + [ENER2] ) / 1000000, 2) AS NUMERIC(9, 2)) AS VARCHAR(10))
else
'0' + cast(Cast(Round(( [ENER1] +...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 20, 2014 at 12:20 pm
nonghead-webspam (2/19/2014)
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2014 at 10:08 pm
blasto_max (2/19/2014)
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2014 at 9:50 pm
In many cases, people who have these types of Pivots also eventually want a "Total" column. The ancient "Black Art" of CROSSTABs easily allows for such a thing.
SELECT...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2014 at 9:39 pm
Cees Cappelle-442904 (2/19/2014)
I'll look into the FK thingie. Would be nice if you could point me in the right direction to modify my sp to CTE instead of cursors.
Apologies for...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2014 at 8:53 pm
SQLRNNR (2/19/2014)
Yay - I'm finally insane!!! :hehe::w00t:
Very cool! Congratulations!
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2014 at 8:45 pm
SQLRNNR (2/18/2014)
Jeff Moden (2/18/2014)
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2014 at 10:11 pm
Lempster (2/18/2014)
Quirky Update?
That would be the ticket. It may take more than one pass but it would be nasty fast (heh... I'm a poet and don't know it).
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2014 at 10:04 pm
It's not really a stumper the way I did it. According to the groupings, the correct answer displays. The problem is that's not the answer that you're expecting.
Shifting...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2014 at 9:58 pm
Steve Jones - SSC Editor (2/18/2014)
Jeff Moden (2/18/2014)
Steve Jones - SSC Editor (2/18/2014)
Jeff Moden (2/16/2014)
As I stated peviously, the OP is frequently the worst person to judge answers. You...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2014 at 9:55 pm
smhaig (2/18/2014)
Wouldn't mind seeing a sample of a worst case CTE and a solution with a temp table, for example.
Just write a nice little 30 table query into a...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2014 at 9:52 pm
To me, the critical question is, is the data important whether it changes or not? If so, put it in the database because no one will protect the data...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2014 at 9:51 pm
Viewing 15 posts - 24,316 through 24,330 (of 59,099 total)