Viewing 15 posts - 16 through 30 (of 45 total)
Thanks Jeff. I will look into the cross-apply solution. I always learn something new when I'm here 🙂
April 24, 2015 at 2:51 pm
Thanks, I was hoping there would be some kind of loop (beyond my level) or something that could iterate through each account.
Ideally, I'd like to avoid creating a duplicate query...
April 24, 2015 at 1:06 pm
Lowell (2/3/2015)
can you just sum up the differences btween the two dates?
--days
/*--Results
account loc (No column name)
1 ...
February 3, 2015 at 1:31 pm
This is beautiful. Thank you very much.
I was trying with a case like you did, but without success. I am curious about this piece of your code:
CASE WHEN...
August 5, 2014 at 9:50 pm
Thanks for your reply, I appreciate you taking the time to help with this.
After testing your query with a few different scenarios, I came across a slight problem. I...
August 5, 2014 at 7:49 pm
Looks like I just figured out my own problem. Here's my solution. Just closing the loop.
SELECT staffid,account FROM
(select
ROW_NUMBER() OVER(PARTITION BY staffid ORDER BY newid() ) AS RowID
,...
October 9, 2012 at 3:55 pm
charu.verma (12/1/2009)
As per above suggestions, I tried to use tab as a query separator but still all the query data is coming in the same column..Is there something that I...
December 2, 2009 at 10:59 am
Thanks for both of your responses.
Lowell, thanks for the explanation. Made sense when you put it so simply.
August 7, 2009 at 10:17 am
true, pivot table may be the way to go. thanks.
April 23, 2009 at 11:49 am
Great thankyou, works perfectly. Always so simple once you see the solution.
noeld (11/18/2008)
DECLARE @account int, @from datetime, @to datetime
select @account = 1 , @from...
November 21, 2008 at 3:56 pm
Great thank you. This works perfectly.
Chris Harshman (10/16/2008)
October 17, 2008 at 7:29 am
thank you for the detailed response, I really appreciate it. Very informative I had thought about a temporary table also but your explanation clarified exactly how to do...
August 18, 2008 at 1:31 pm
thank you; this gave me exactly what I need
Zahran (7/29/2008)
Try this,
SELECT COUNT(ACCOUNT) FROM
(SELECT COUNT(DISTINCT ACCOUNT) AS ACCOUNT
FROM dxhistory
WHERE RANK=1
GROUP BY ACCOUNT, RANK
HAVING COUNT(RANK)>1)AS T
August 18, 2008 at 1:30 pm
this returns rows of 1's
Zahran (7/29/2008)
You can use this query too...
SELECT
COUNT (DISTINCT ACCOUNT)
FROM dxhistory
WHERE RANK=1
GROUP BY ACCOUNT, RANK
HAVING COUNT(RANK)>1
July 29, 2008 at 1:54 pm
Viewing 15 posts - 16 through 30 (of 45 total)