Viewing 15 posts - 481 through 495 (of 842 total)
October 18, 2017 at 3:32 pm
I modified your data and tried to use ChrisM's code. I added a value to C2 in #T3, Chris's code still says C2 is NULL on all 3 tables. I...
October 18, 2017 at 9:23 am
Since your 3 tables have the same layout couldn't you union them together into one table then check that one table's columns for NULL?
If you are working with...
October 13, 2017 at 2:00 pm
Your statement:
Nested case stmt
(case when gn.glacctid = 25 then t.amex end ) +
(case when gn.acctid = 26 then t.vmc end) +
case when gn.acctid = 22 the...
October 13, 2017 at 1:44 pm
What about using what I like to call a 'stacked' table to put this in? You use the unpivot, in combination with a prior post on getting the column names. ...
September 28, 2017 at 9:58 am
IMHO, never ever use spaces. Use underscores to make it more readable to the users. I prefer underscores to camel, but I usually follow what the 'standard' is for the...
September 26, 2017 at 3:29 pm
I would not pay for anything, if the company wants me to try something then they can pay for it. If I was asked to pay for a mistake I...
August 29, 2017 at 8:42 am
IMHO I would try removing the SUM and group by from the 'meat' SQL, since you are summing the data in the other SQL. I'm not saying it will help...
August 1, 2017 at 12:50 pm
Here is what I've used to search for fields within SSIS packages(dtsx files) stored in the MSDB database.
--Connect to database: msdb
SELECT [name] AS SSISPackageName,
July 26, 2017 at 7:32 am
I guess I wanted this because of the reason I needed it last year. I used to have my work email address associated with my account. Password was being saved...
July 3, 2017 at 9:53 am
If you want to do it with Substring and CHARINDEX here you go.
<SQL>
DECLARE @testVARCHAR(500);
SET @test-2 = 'http://stable-test.test.net/api/files/fs.testcollection/TP-0000000.pdf/download/';
SELECT SUBSTRING(@test,
CHARINDEX('/', @test-2, CHARINDEX('/', @test-2, CHARINDEX('/', @test-2,...
June 22, 2017 at 11:58 am
The same query...
June 21, 2017 at 1:26 pm
I think this would work.
SELECT SUBQ.issue_number, SUBQ.type_code, SUBQ.alt_type_code,
SUM(SUBQ.data_value_1) AS data_value_1_sum,
SUM(SUBQ.data_value_2) AS data_value_2_sum
FROM (SELECT issue_number, line_number, type_code,
CASEWHEN alt_type_code IN ('NONE', '')
THEN '00'...
June 20, 2017 at 12:21 pm
Back in the mid 80's I was going to school at DeVry in Kansas City. We had to submit our COBOL programs to compile during our one hour lab time....
February 22, 2017 at 1:42 pm
Here is what I came up with:
SELECT ISNULL(ac.code, b1.code) AS code, a2.aname, b1.bname, ac.cname
FROM (SELECT a.code, a.aname, c.cname, ROW_NUMBER() OVER (Partition BY a.aname ORDER BY a.code, a.aname) AS RNO
FROM @a...
January 6, 2017 at 11:58 am
Viewing 15 posts - 481 through 495 (of 842 total)