Viewing 15 posts - 346 through 360 (of 1,439 total)
Assuming the shift pausetimes don't overlap, this should give the worktimes
DECLARE @tblSchema TABLE (Shift INT, Code INT, dtBegin DATETIME, dtEnd DATETIME)
INSERT INTO @tblSchema(Shift,Code,dtBegin,dtEnd)
VALUES
(1, 1, '20130611 06:00:00', '20130611 14:21:00'),
(1, 11, '20130611...
June 12, 2013 at 3:45 am
You might want to try this sort of query instead
SELECTid, oracle_id, field1, field2, field3, field4,
COUNT(*) OVER(PARTITION BY field1,...
June 11, 2013 at 8:19 am
I suspect you could use sp_getapplock / sp_releaseapplock here
June 7, 2013 at 7:03 am
... and identical solutions too!
June 6, 2013 at 6:28 am
DECLARE @Graph_Range TABLE(Start_Range FLOAT, End_Range FLOAT);
INSERT INTO @Graph_Range(Start_Range, End_Range)
VALUES (0.10, 0.20), (0.20, 0.30), (0.30, 0.40);
DECLARE @Graph_data TABLE(Asset_Value INT, factor FLOAT, [Case] INT);
INSERT INTO @Graph_data(Asset_Value, factor, [Case])
VALUES (500, 0.12, 1),(270, 0.13,...
June 6, 2013 at 6:22 am
Another way
with cte as (
select [State], County, Sex, class,
case when Agegroup in ('15-17 yrs', '18-20 yrs', '21-24 yrs') then '15-24 yrs' else Agegroup...
June 4, 2013 at 1:35 am
Try this
DECLARE @t TABLE(ID INT, X XML)
INSERT INTO @T(ID,X)
VALUES(1,'<root>
<name1 row = "1" value ="1" />
<name2 row = "1" value ="2" />
<name1 row = "2" value ="3" />
<name2 row = "2"...
June 3, 2013 at 7:48 am
Try changing
'20130401' + 90
to
CAST('20130401' AS DATETIME) + 90
May 30, 2013 at 8:29 am
Here's a SQL Server 2012 version
WITH CTE AS (
SELECT number,
am_sw,
MAX(cc_sw) OVER (PARTITION BY number
...
May 30, 2013 at 7:37 am
SELECT
context_id
,a.alias.value('(KeyValueId/text())[1]','Varchar(20)') AS 'KeyID'
,a.alias.value('(Value/text())[1]','Varchar(20)') AS 'Value'
,a.alias.query('.') AS 'Node'
FROM (
.
.
.
May 30, 2013 at 4:28 am
Very inefficient but gives correct results
SELECT Students AS Name,
CASE WHEN COUNT(*) > 1 THEN 'Y' ELSE 'N' END AS IsASequence,
...
May 29, 2013 at 3:50 am
mister.magoo (5/28/2013)
Sean Lange (5/28/2013)
dwilliscp (5/28/2013)
May 29, 2013 at 3:02 am
Without DDL, sample data and expected results this is just a guess....
select right(convert(varchar, CCD.startDateTime , 106), 8) as startmonth,
sum(case when CCD.contactDisposition=1 then 1 else 0 end) as...
May 28, 2013 at 8:38 am
Change
partition by fk_stationid
to
partition by fk_stationid , AdDate
May 15, 2013 at 9:27 am
SELECT AdDate, AdTime, FK_StationId, CAST(rank() over(partition by fk_stationid order by addate,adtime) AS VARCHAR(10)) + ' of ' +
...
May 15, 2013 at 6:27 am
Viewing 15 posts - 346 through 360 (of 1,439 total)