Viewing 15 posts - 661 through 675 (of 4,085 total)
I would take a different approach. Your two queries are very similar. Rewrite your query to pull any record that would meet either criteria and then use two CASE/IF expressions:...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 13, 2019 at 1:30 pm
I actually prefer using the first of the month to group dates.
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 13, 2019 at 1:17 pm
Gee, thanks so much for the effort here. Much appreciated.
I am using SQL 2008...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 13, 2019 at 12:01 pm
You can simplify this by using a different default value for the lag function.
WITH LAG_DATA AS (
SELECT
TT.rn,
TT.dt,
TT.[status],
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 13, 2019 at 10:35 am
You can also use TRY_CAST() or TRY_CONVERT() to identify which records have issues. Each of these will produce a NULL value instead of an error when the conversion fails. J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 13, 2019 at 9:26 am
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 13, 2019 at 9:22 am
It's not quite in the format you asked for, but it can easily be tweaked.
CREATE TABLE #Customer_Balances
(
Customer_ID INT
, Cur_Balance MONEY
, As_of_Date ...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 12, 2019 at 3:10 pm
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 12, 2019 at 2:05 pm
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 12, 2019 at 12:26 pm
Mike D - Tuesday, February 12, 2019 7:55 AMWhy not use a view for computed columns? Is this not clearer?
I...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 12, 2019 at 11:51 am
I see nothing here that argues for a dynamic approach. Post sample data and expected results, and we should be able to help you come up with an approach that...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 12, 2019 at 11:33 am
You also need to specify the logic used to determine which values appear together. NOTE: Tables represent sets, which are unordered. The display order is not a valid option. J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 11, 2019 at 1:00 pm
[CompanyId](Display:...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 11, 2019 at 9:10 am
Excel does not have a NULL value. It has a BLANK value which is equivalent to ''. When '' is converted to numeric, it is converted as 0. You may...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 6, 2019 at 12:21 pm
My questions are:
1. Regarding the act of breaking out the department details what is this...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
February 6, 2019 at 12:14 pm
Viewing 15 posts - 661 through 675 (of 4,085 total)