Viewing 15 posts - 466 through 480 (of 2,462 total)
DECLARE @table TABLE (stateName varchar(20), Count1 int, TotalChargeOffAmount int);
INSERT @table
VALUES
('Alabama',5,1000),
('Arizona',2,4000),
('Arkansas',3,5000);
SELECT
stateName,
Count1,
TotalChargeOffAmount,
[% of Total Count] = ((Count1*1.)/CountTotal)*100
FROM @table t1
CROSS...
-- Itzik Ben-Gan 2001
September 15, 2016 at 11:22 am
Phil Parkin (9/15/2016)
Steven.Grzybowski (9/15/2016)
Jeff Moden (9/14/2016)
Best way to fix this is to have a pork chop dinner with the people that are providing the data. 😉
I wish I could....
-- Itzik Ben-Gan 2001
September 15, 2016 at 7:21 am
Alternatively, you could create a specialized version of DelimitedSplit8K_LEAD[/url] that handles this (I'll let you come up with a better name;-)). My modification is bold/underlined.
CREATE FUNCTION [dbo].[DelimitedSplit8K_LEAD_XX]
--===== Define I/O...
-- Itzik Ben-Gan 2001
September 14, 2016 at 3:53 pm
What lptech posted may help. This is a pretty simple task. The way I would approach it is to:
1. Create a script task (whatever language works for you) that compares...
-- Itzik Ben-Gan 2001
September 14, 2016 at 3:14 pm
In Visual Studio:
1. Create an SSRS table with columns for surgical procedure & surgery date.
2. Click on that table then, under Row Groups, right-click on the "=(details)" group and...
-- Itzik Ben-Gan 2001
September 14, 2016 at 10:33 am
Why not just create a table that contains the column names of <mytable> and their ordinal position. You could name it <mytable>_cols. Then use some logic in your dynamic SQL...
-- Itzik Ben-Gan 2001
September 13, 2016 at 8:16 pm
I think that this is what you are looking for:
-- Sample data
IF OBJECT_ID('tempdb..#YourData') IS NOT NULL DROP TABLE #YourData;
SELECT *
INTO #YourData
FROM
(VALUES
('162386-00','CHB',263,203,143,83,23,0,0),('162386-00','GRR',44,44,44,44,44,44,44),
('162386-00','MAR',0,0,0,0,0,0,0),('162387-00','CHB',83,83,83,83,83,83,83),
...
-- Itzik Ben-Gan 2001
September 13, 2016 at 9:48 am
EasyBoy (9/13/2016)
-- Itzik Ben-Gan 2001
September 13, 2016 at 9:23 am
TheSQLGuru (9/12/2016)
ROWS is (almost ?) ALWAYS offers MUCH better performance than RANGE! Try your best to use ROWS when possible.
I don't know about ALWAYS. I said ROWS "often" (and could...
-- Itzik Ben-Gan 2001
September 12, 2016 at 3:14 pm
You beat me to it. Note that ROWS often performs better than range and can be used to calculate your HQuantity. Also note that the subquery is not required, you...
-- Itzik Ben-Gan 2001
September 12, 2016 at 10:32 am
chris.evans 94907 (9/12/2016)
Thanks for the reply.
The script you provided returns the following results:
calDate ...
-- Itzik Ben-Gan 2001
September 12, 2016 at 8:36 am
My advice to managers is always to keep up with technology and maintain their technical skills.
Since getting into technology in 1999 I've worked for two types of bosses:
1. Those...
-- Itzik Ben-Gan 2001
September 12, 2016 at 8:23 am
The Dixie Flatline (9/9/2016)
Alan.B (9/9/2016)
I just spent 5 minutes trying to figure out whey this INSERT statement was failing"Whey" is the second hint. Have a great weekend 😀
You...
-- Itzik Ben-Gan 2001
September 9, 2016 at 3:08 pm
Ed Wagner (9/9/2016)
Alan.B (9/9/2016)
Haha, silly American! I think "06/09/2016 " is September 6th where the OP is from. 😛
Touche, sir. I never thought to check the profile to see...
-- Itzik Ben-Gan 2001
September 9, 2016 at 2:14 pm
I just spent 5 minutes trying to figure out whey this INSERT statement was failing:
CREATE TABLE dbo.MyTable
(
SocialAdvertisingDimAdKey int IDENTITY(1,1) NOT NULL,
...
-- Itzik Ben-Gan 2001
September 9, 2016 at 2:10 pm
Viewing 15 posts - 466 through 480 (of 2,462 total)