Viewing 15 posts - 3,856 through 3,870 (of 10,144 total)
dwain.c (12/26/2013)
Steven Willis, whom some of you may know...
December 30, 2013 at 2:32 am
eobiki10 (12/23/2013)
December 30, 2013 at 2:20 am
Jeff Moden (12/23/2013)
ChrisM@Work (12/23/2013)
Jeff Moden (12/23/2013)
ChrisM@Work (12/23/2013)
December 23, 2013 at 9:29 am
mattech06 (12/23/2013)
thank you...left join it is then.
Probably - it fits your verbal specification. But don't take it from me. Always test.
December 23, 2013 at 8:14 am
eobiki10 (12/23/2013)
Thanks Chris. Your suggestion works perfectly fine. The APPLY is really the magic wow!!!EO
Excellent. There's a lesson here - know your data. If you knew in advance of writing...
December 23, 2013 at 8:08 am
SELECT
r.dbPatID,
r.dbPatLastName,
r.dbAddDate,
r.LastName,
r.dbStaffLastName,
SUM(t.LedgerAmount) as Outstanding,
(SUM(CASE WHEN t.LedgerAmount <= 0 THEN t.LedgerAmount ELSE NULL END) * -1) as Charges,
SUM(CASE WHEN t.LedgerAmount > 0 THEN t.LedgerAmount ELSE NULL END)...
December 23, 2013 at 7:39 am
Check in Books Online for UPDATE, specifically UPDATE FROM. If you are still unsure, then take the time to read the posting etiquette article linked in my signature "please read...
December 23, 2013 at 6:28 am
Right joins give me a headache:
INSERT INTO tblPricingExc2 --table tblPricingExc2 has an Identity column as PK.
(Key, Flag, Id)
SELECT
tmpExc.Key ,
tmpExc.Flag ,
tmpExc.Id
FROM #tmpPrice tmpExc
LEFT JOIN tblPricingExc2 exc
ON tmpExc.Id = exc.Id
WHERE...
December 23, 2013 at 5:53 am
Jeff Moden (12/23/2013)
ChrisM@Work (12/23/2013)
December 23, 2013 at 5:25 am
Have you tried aggregating the bills in isolation from the rest of the query? Here's one way which looks clean and performs quite well:
SELECT
p.period
,m.clnt_matt_code AS [Client Code]
,m.matter_name
,o.offc_desc
,'Insolvency' AS matter_code
,ISNULL(l.Merged_Source_of_Work_Lender_Desc,k.name)...
December 23, 2013 at 5:20 am
Please post a sample data script as per this article [/url]- it's very difficult to tell what you are looking for.
December 23, 2013 at 4:46 am
Is bo_Live5.dbo.BLT_BILLM the only table in your FROMlist which has sets of rows having the same value of MATTER_UNO/matter_name?
Are you expecting, in your output, only one row per matter_name?
December 23, 2013 at 4:40 am
Your code is missing GROUP BY and will throw an error without it.
Tableb places no restriction on which rows of Tablea are selected for output because it's left-joined. As Jeff...
December 23, 2013 at 3:18 am
Please post some sample data and the expected output. It's very difficult to tell what you want from your description.
December 23, 2013 at 2:58 am
dwain.c (12/23/2013)
Brilliant Jeff, simply brilliant!
Tops my offering by a mile:
;WITH Subproducts AS (
SELECT PrimaryID = LEFT([Product Id],CHARINDEX('.',[Product Id],0)-1), *
FROM #Product_Table
WHERE IsPrimary <> 1)
SELECT
PrimaryID,
Subproduct = '',
quantity...
December 23, 2013 at 2:21 am
Viewing 15 posts - 3,856 through 3,870 (of 10,144 total)