Viewing 15 posts - 2,131 through 2,145 (of 4,085 total)
paul.biltcliffe 32759 (12/2/2016)
Data Types:a.client = nvarchar(25), not null
a.status = nvarchar(1), not null
a.attribute_id = nvarchar(4), not null
On an unrelated note, why are you using nvarchar(1) for your status instead of nchar(1)?...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 5, 2016 at 9:15 am
Phil Parkin (12/2/2016)
Just having a mind warp on how to insert into the address table and get that unique int value and put it into the correct master row for...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 2, 2016 at 11:24 am
JALLY (12/2/2016)
Your solution above will create a conflict between columns that rely on the the sub queries for their source of data and the multi part identifier 'inv.active' will not...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 2, 2016 at 11:08 am
You can't have a WHERE clause in the middle of your JOIN clause. Just move your WHERE clause after ALL of the JOIN clauses.
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 2, 2016 at 9:37 am
Something seems off here. You're worried about a new student status affecting the sort order, but that's impossible, because the student status defines the partition. You say that...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 2, 2016 at 8:24 am
Here is the updated code:
;
WITH unique_dates AS (
SELECT DISTINCT p.Price, d.dt, d.is_start
FROM #prices p
CROSS APPLY (VALUES(p.date_from, 1), (DATEADD(DAY, 1, p.date_to), 0)) d(dt, is_start)
)
, packed_dates AS (
SELECT ud.price, ud.dt, ud.is_start,
CASE
WHEN LEAD(ud.dt,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 1, 2016 at 9:16 am
UPDATE does allow you to use a named table as long as it's not the one being updated. If you use the name of the table that's being updated,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 1, 2016 at 8:47 am
You can't. Temp tables are only visible to the session that created them.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 30, 2016 at 4:08 pm
dsmith402 (11/29/2016)
Ok, that certainly makes sense. But how would this expression be re-written in order for it to work?
It depends on what you are trying to solve, which is why...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 30, 2016 at 9:55 am
You have both a CASE expression and a COALESCE. For each of those, the possible values must be of compatible data types.
,coalesce(case WHEN FSI.FID IN ('1800','1810')
and FSI.StepCompletion is not...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 29, 2016 at 4:23 pm
wjh_uk (11/28/2016)
With the following data the faster version...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 29, 2016 at 12:42 pm
You say you want running totals, but your expected results look like they are the first step in getting your expected running totals. If that is the case, there...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 29, 2016 at 11:06 am
This is a variation of the packing intervals problem. Since you have no gaps and no overlaps you can treat it as a gaps and islands problem where the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 28, 2016 at 4:03 pm
Your text contains a single quote that hasn't been properly escaped. You need to use two single quotes in your text to get one single quote, so child's should...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 28, 2016 at 3:41 pm
Remove the GROUP BY. You're getting totals for every status when you only want the grand total.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 28, 2016 at 11:40 am
Viewing 15 posts - 2,131 through 2,145 (of 4,085 total)