Viewing 15 posts - 151 through 165 (of 283 total)
Gerry Roston (2/23/2015)
However this seems odd - I need to divide, then multiple by the same constant value. Is there a better...
February 23, 2015 at 2:56 pm
Gerry Roston (2/23/2015)
SELECT StartTime + Offset, min(Sensor), max(Sensor)
FROM SensorData
WHERE SensorID = @SensorID AND
StartTime + Offset > @BeginTime AND
StartTime + Offset < @EndTime
GROUP BY (StartTime +...
February 23, 2015 at 1:38 pm
Jeff Moden (2/23/2015)
So, let me ask... do you have an Employee table or an Employees table?...
February 23, 2015 at 1:28 pm
robert.wiglesworth (2/23/2015)
01/15/2015 07/31/2015 2555 ...
February 23, 2015 at 1:18 pm
KGJ-Dev (2/14/2015)
Hi,expected result :
IDmessage
1Testing 1, Testing 2, Testing 3
2Testing 6, Testing 7, Testing 8
3Testing 11, Testing 12, Testing 13
any help please
I just added a TOP 3 to the select...
February 14, 2015 at 9:15 am
Lowell (2/10/2015)
must be missing something in the question...
Same thought crossed my mind.
With the given information, I am guessing that the ending date is just a magic date far in...
February 10, 2015 at 8:49 am
Sioban Krzywicki (1/23/2015)
Sure! That's a way you can do it. Want to post some code to share with people? I find multiple ways of doing things is both nice to...
January 23, 2015 at 10:49 am
denis.gendera (1/21/2015)
the 2nd query does acutally use function to return rows and that should also be populated with the info from first...
January 21, 2015 at 11:12 am
denis.gendera (1/21/2015)
I'm using SQL Function and doing the...
January 21, 2015 at 10:32 am
KGJ-Dev (1/20/2015)
DECLARE @Affected TABLE (UserId INT);
WITH data
AS (
SELECT UserId
,ProcessingAmout = SUM(COALESCE(Amount, 0))
FROM @tblCompanyProess
WHERE IsProcessed = 0
)
UPDATE @UserBalance
SET UserAmountBalance = COALESCE(B.UserAmountBalance, 0) + D.ProcessingAmout
OUTPUT INSERTED.IdMember
INTO @Affected(IDMember)
FROM @UserBalance UB
INNER...
January 20, 2015 at 1:55 pm
dmj120 (1/20/2015)
January 20, 2015 at 11:11 am
Here is another even simpler solution!
declare @t table
(
ID int
, code1 char
, code2 char
)
insert @t values
(1,'a','m')
,(1,'b','n')
,(1,'c','T')
,(2,'d','m')
,(2,'e','n')
,(2,'f','n')
,(3,'g','m')
,(3,'h','n')
,(3,'i','T')
;with cte as
(
Select id
...
January 9, 2015 at 10:38 pm
This is a way to get the top 3 unique order amounts for each Salesman_ID. This uses the same data set that I posted previously.
;with cte as
(
...
December 2, 2014 at 10:27 am
sdh96 (12/2/2014)
That worked great but there are repetative dollar amounts. Can you display how to retrieve the exact same information but three distinct dollar amounts.
I threw this data together...
December 2, 2014 at 9:05 am
Viewing 15 posts - 151 through 165 (of 283 total)