Viewing 15 posts - 3,526 through 3,540 (of 4,085 total)
bass8117 (10/27/2011)
in the CHRG0.CHRG_AMT column I have a reverse charge of -289.00 with a CHRG0.CHRG_BAL...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 28, 2011 at 7:31 am
Actually, I didn't read your query closely enough. I didn't see that you were using a subquery.
The two approaches are equivalent and will give the exact same execution...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 27, 2011 at 7:57 am
Here is a fairly simple way to get what you're looking for.
SELECT Year(ms.MonthStart), Datename(Month, MonthStart), WeekOfMonth, Sum(YourAmountField)
FROM YourTable AS l
CROSS APPLY ( SELECT DateAdd(Month, DateDiff(Month, 0, GetDate()), 0) AS MonthStart...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 27, 2011 at 7:49 am
Depending on your indices and your data, the following may be more efficient.
SELECT
o.OrderID,
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 27, 2011 at 7:09 am
pschwartzbauer (10/26/2011)
SELECT A.Key, A.Date, A.Status, A.Ranking
FROM (SELECT Key, Date, Status
, RANK() OVER(PARTITION BY Key ORDER BY Date DESC) AS Ranking
FROM table) A
WHERE A.Ranking...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 27, 2011 at 6:46 am
TEXT is being deprecated. Use varchar(max) instead.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 26, 2011 at 1:55 pm
Ninja's_RGR'us (10/25/2011)
Try LEFT(middlename + '.', 1) instead.That'll work depending on your concat_null_yields_null setting.
You really should test before posting. I think what you wanted was actually
ISNULL(LEFT(middlename, 1) + '.', '')
This...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 25, 2011 at 11:35 am
dva2007 (10/25/2011)
It doesnt have any unique key and the uniqey key is 70 character long.
If it doesn't have a unique key, how are you able to determine it's length?
If your...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 25, 2011 at 9:33 am
mpartridge (10/20/2011)
td = '<a href="mailto:abc@xyz.com?Subject=Mailto%20Test&cc=xyz@abc.com">mailto:abc@xyz.com</a>', ''
SQL will not recognise that as a HTML link and pastes the whole thing into a table cell,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 24, 2011 at 12:42 pm
The typical way to do this is with FOR XML PATH. Most examples will also use a stuff to remove an initial extraneous delimiter, but I didn't include that...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 20, 2011 at 9:22 am
Sean Lange (10/19/2011)
declare @Codes varchar(25) = '14, 8, 21458'
;with cte(n) as (select 1
union all select 14
union all select 214
union all select 314
union all select 15
union all select 8)
select *
from...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 20, 2011 at 7:04 am
toddasd (10/19/2011)
Declare @Type_Code varchar(50)
set @Type_Code = '4,11,12'
Select * from table_Type_Codes Where @Type_Code like '%' + table_Type_Codes...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 19, 2011 at 3:11 pm
I would use LIKE instead. You'll probably still have to do an Index Scan (assuming that column is indexed on your claim table), but that will probably save you...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 19, 2011 at 11:46 am
There's another approach that edges out the CROSS APPLY approach. Depending on your indexes, this approach might be better.
PARTITIONED AGGREGATE
WITH OrdersRanked AS (
SELECT [CustomerID],ShipVia
, Sum(Freight) OVER( PARTITION BY CustomerID...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 19, 2011 at 10:01 am
Lowell (10/18/2011)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 18, 2011 at 3:19 pm
Viewing 15 posts - 3,526 through 3,540 (of 4,085 total)