Viewing 15 posts - 46 through 60 (of 94 total)
Hi,
sorry no, if the data was
Desc Amt
bob 10
tim 20
jim 30
then I'm after a result set of
Desc Amt
bob 60
so first row...
June 18, 2014 at 5:23 am
Thanks Sean, that did the trick...give yourself a 1000 points!
May 30, 2014 at 3:56 am
Hi, yes!
SELECT
b.TransDate, b.TransType, b.SortCode, b.AccNum, b.TransDesc,
(ISNULL(b.Debit, 0) + ISNULL (b.Credit, 0)) as Amount,
ISNULL(r.OrthoID, 999) as OrthoID
ISNULL(t.PatientID, 0) as PatientID
FROM
EPSBankTransactions b
...
May 28, 2014 at 8:09 am
can you use those functions in the FROM section?
This is the working vers, not my sample from above and includes a ref table as well and there's a bit more...
May 28, 2014 at 7:52 am
sorted it out, didn't think it would work for some reason but
LEFT JOIN EPSBankRef r on SUBSTRING(b.TransDesc, 0, 21) = r.BankID
does the job.
May 25, 2014 at 7:42 am
The performance seems fine, I'll test it with our biggest client tomorrow but I'll note your comments/links anyway for future ref, thanks.
May 12, 2014 at 10:07 am
You're a genius John (or at least someone who knows more sql than me 🙂 thanks.
May 12, 2014 at 9:45 am
That's great, thanks guys.
March 25, 2014 at 10:44 am
They both do the job thanks BUT I forgot to mention I wanted to select DISTINCT lastName's, is that possible using a cte?
March 25, 2014 at 7:19 am
Hey that seems to work on my test data Mitesh (I'll try it on the live stuff in a mo).
One question tho, why did you add?
AND (r.dbStaffLastName IS NULL OR...
February 21, 2014 at 2:53 am
good point, but how do I join them?
February 21, 2014 at 2:28 am
thanks guys
February 18, 2014 at 1:29 am
Viewing 15 posts - 46 through 60 (of 94 total)