Viewing 15 posts - 1,081 through 1,095 (of 1,246 total)
sharonmtowler (8/5/2015)
someone sent me this from a different forumROW_NUMBER() OVER (PARTITION BY S.SESSIONID ORDER BY PL.enter_time) AS location_sequence_id
works like a charm!!!
If SessionID was a necessary part of the solution, you...
August 5, 2015 at 8:29 am
This should illustrate how to do it in SQL... (Since no one ever takes the "let the reporting software do it" advise.)
-- Test Data --
IF OBJECT_ID('tempdb..#Transfers') IS NOT NULL
DROP...
August 5, 2015 at 7:49 am
sharonmtowler (8/5/2015)
I have patients that may have been transferred to different locations(see below)
location_name enter_time
4D04 2/9/15 2:35
4D14 2/9/15 8:44
RECOVERY 3...
August 5, 2015 at 7:37 am
newbieuser (8/4/2015)
What are other causes that make check/FK constraints non trusted because we normally don't enable/disable constraints during loads or scripts or anything. We always drop and re-create...
August 4, 2015 at 2:26 pm
The attached script should help you generate usable test data... Simply plug in the table name (line 12) and the number of rows you want (line 18)
If you need to...
August 4, 2015 at 2:02 pm
There are a few way of doing this, depending on what you want to do.
If your SSRS parameter is single single valued parameter (the user can select only a single...
August 4, 2015 at 7:31 am
If you're trying to create a pick list for an SSRS parameter, you're going about it all wrong.
Each SSRS parameter (that you want to have a pick list) just needs...
August 4, 2015 at 6:28 am
Rahuul (8/2/2015)
Thanks a lot Jason.Saved my day!!
You're welcome! Glad to help. 🙂
On another note, could it be done using Pivot?
Yes. There are several ways to write this query.
August 2, 2015 at 7:06 am
This should give you what you're looking for...
-- Test data --
IF OBJECT_ID('tempdb..#temp') IS NOT NULL
DROP TABLE #temp;
CREATE TABLE #temp (
FY INT,
REVCODE VARCHAR(3),
Jul INT,
Jun INT
);
INSERT #temp (FY,REVCODE,Jul,Jun) VALUES
(2015,'BNQ',1054839,2000000),
(2015,'FNB',89032,1000000),
(2015,'RS',1067299,3000000);
-- The solution --
SELECT
t.FY,
x.[Month],
SUM(CASE...
August 1, 2015 at 7:07 pm
Try this...
UPDATE h SET
h.CHANNEL1 = vc.C1,
h.CHANNEL2 = vc.c2
FROM
#Hori h
JOIN (
SELECT
v.FILTER,
MAX(CASE WHEN v.CHANNEL = 1 THEN v.VALUE END) AS C1,
MAX(CASE WHEN v.CHANNEL = 2 THEN v.VALUE END) AS...
July 31, 2015 at 8:24 am
PJ_SQL (7/31/2015)
I get this error :Invalid column name 'RN'.
Have a look at the following... I included two different solutions... Either approach could be faster than the other depending on the...
July 31, 2015 at 8:07 am
Luis Cazares (7/30/2015)
What are you expecting to accomplish with the subquery? It basically compares one column to itself joined by the same condition.
Looks like an expensive attempt to get the...
July 30, 2015 at 5:07 pm
tstagliano (7/30/2015)
Country_code Local_client_code Local_client_name ...
July 30, 2015 at 10:49 am
Yea... I see what you did. Sounds like you're the one with the correct interpretation of the requirements. Nice solution BTW. With a couple of indexes it would be easy...
July 29, 2015 at 3:33 pm
Robert klimes (7/29/2015)
The results aren't quite right(terms 2 and 3 are low) but I will have a look to see if I can tweak this.
I read "Cumulative Average" to mean...
July 29, 2015 at 2:52 pm
Viewing 15 posts - 1,081 through 1,095 (of 1,246 total)