Viewing 15 posts - 3,106 through 3,120 (of 10,144 total)
Not enough information. Can you post the stored procedure code?
July 21, 2014 at 6:46 am
CONVERT uses style codes to control output and input formatting:
declare @ToDate datetime, @FromDate datetime
SELECT -- UK format
@FromDate = CONVERT(DATETIME,'21/06/2014',103),
@ToDate = CONVERT(DATETIME,'21/07/2014',103)
select @FromDate,...
July 21, 2014 at 6:20 am
wBob (7/21/2014)
SELECT c2.*
FROM ( SELECT DISTINCT CoverageCode FROM dbo.[Contract] ) x
CROSS APPLY ( SELECT TOP 5 * FROM dbo.[Contract] c WHERE...
July 21, 2014 at 6:08 am
T-SQL beginnger (7/18/2014)
Any help for the 2nd part guys ?
I agree with Luis, it's very difficult to work with filters as complex as this without sample data. However, here's a...
July 21, 2014 at 5:29 am
Here's the final solution:
;WITH
SeqID1 AS (
SELECT x.ID, x.RowID, x.Value, MAXReadingdate = x.Readingdate
FROM (
SELECT *, rn = ROW_NUMBER() OVER(PARTITION BY ID ORDER BY Readingdate DESC)
FROM #tempreadings t
) x
WHERE...
July 21, 2014 at 4:52 am
ramrajan (7/21/2014)
Yes that is Really Working.But i need to do additional join with deliveries to get few more records as mentioned in my post.
Yes I know. One step at a...
July 21, 2014 at 3:02 am
ramrajan (7/21/2014)
--- We Need to join The above Results Set 3 With #tempdeliveries Based ON ID and We need...
July 21, 2014 at 2:49 am
"The most recent reading which is more than 24 hours before the max reading date"?
Like this:
;WITH OrderedData AS (
SELECT *, rn = ROW_NUMBER() OVER(PARTITION BY ID ORDER BY Readingdate DESC)...
July 21, 2014 at 2:30 am
ramrajan (7/21/2014)
Please read it as "ReadingDate IS 24 Hours Less Than the max Reading Date "Appreciate your response
To help resolve this, I've rejigged the sample data to add a row...
July 21, 2014 at 2:17 am
ramrajan (7/21/2014)
.
.
-- Result 2
-- In The same Query I want the ReadingDate For Each ID And the ReadingDate IS 24 Less Than the max Reading Date of Each ID ....
July 21, 2014 at 2:08 am
Sreepathi1987 (7/21/2014)
Easy One. 🙂But i think it is rather unusual, tempdb is completely wiped out whenever the SQL Server service restarts. Yes or No?
Yes, which makes tempdb useful as...
July 21, 2014 at 1:44 am
Not really. NTILE(n) splits a set into n partitions.
July 21, 2014 at 1:41 am
Ed Wagner (7/18/2014)
SQLRNNR (7/18/2014)
mangaCarta
Runnymede
July 18, 2014 at 9:49 am
pmadhavapeddi22 (7/18/2014)
I am sorry, Chris for not mentioning your name. Thanks for your support
Happy Friday 🙂
July 18, 2014 at 9:10 am
Viewing 15 posts - 3,106 through 3,120 (of 10,144 total)