Viewing 15 posts - 3,631 through 3,645 (of 4,820 total)
Try this:
WITH YT1 AS (
SELECT YT.ID, YT.[Date], YT.Stat1
FROM YourTable AS YT
WHERE YT.Stat1 IS NOT NULL
AND YT.[Date] = (SELECT MAX(Y.[Date]) FROM YourTable AS Y WHERE Y.ID = YT.ID)
),
YT2 AS (
SELECT YT.ID,...
June 18, 2015 at 1:28 pm
jparks 85798 (6/18/2015)
Thanks for the follow up. I agree, the windowed functions are nice, but not quite as robust as I had hoped. As for the datetime...
June 18, 2015 at 12:42 pm
sqlinterset (6/18/2015)
IF OBJECT_ID('tempdb..#complaints') IS NOt NULL
DROP TABLe #complaints
--===== Create the test table with
create table #cs([Year] float,
[Week] float,
[Month] float,
[C#] float,
[Dept] nvarchar(255)
,[Issue]...
June 18, 2015 at 12:35 pm
jparks 85798 (6/18/2015)
My first post here and i'm still relatively new to t-sql. I have searched around and I am completely stuck on where to even start. I am using...
June 18, 2015 at 11:49 am
Let's try this:
DECLARE @TA AS TABLE (Id int,CheckValue nvarchar(10),[Status] int)
INSERT INTO @TA VALUES(123,'60',1)
INSERT INTO @TA VALUES(123,'45',0)
INSERT INTO @TA VALUES(123,'76',0)
INSERT INTO @TA VALUES(123,'50',0)
DECLARE @TB AS TABLE (Id int,OCheckValue nvarchar(10),CheckValue nvarchar(10),OValue int)
INSERT...
June 18, 2015 at 9:38 am
craig.g.smith (6/17/2015)
June 18, 2015 at 9:03 am
NineIron (6/17/2015)
Thanx.
What are you going to do about non-weekend holidays? At that point, just using 7 weekdays isn't going to keep it straight. There's really no good...
June 18, 2015 at 8:59 am
Lynn Pettis (6/17/2015)
The problem is the commas in the string. Try this select statement:select CONVERT(NUMERIC(17,2),replace(@stg,',',''))
Yes, it will get rid of the commas, but it seems odd that a comma...
June 18, 2015 at 8:23 am
bugg (6/18/2015)
Using the below code as an example this how far i have...
June 18, 2015 at 8:06 am
A couple of additional notes:
1.) Your LEFT OUTER JOINs are getting converted to INNER JOINs because of your WHERE clause seeking a NOT NULL value for the date from the...
June 18, 2015 at 7:44 am
sqlnoob2015 (6/17/2015)
Thank you!!
Basically i want my results...
June 18, 2015 at 7:40 am
jpserra3 (6/17/2015)
Steve, I can re-post this in the access forum, but I was not sure if this may be a permissions...
June 17, 2015 at 4:40 pm
jpserra3 (6/15/2015)
June 16, 2015 at 12:01 pm
idea01 (6/2/2015)
Ozzmodiar (6/2/2015)
There is a very elegant solution to this problem using...
June 16, 2015 at 11:20 am
jayoub (6/16/2015)
connection from occurring after a certain limit has been reached. For
example I set the...
June 16, 2015 at 9:37 am
Viewing 15 posts - 3,631 through 3,645 (of 4,820 total)