Viewing 7 posts - 1 through 7 (of 7 total)
Here is the implemented example using PIVOT..
/*Script to create Sample Data*/
DECLARE @PercentData
TABLE(Name VARCHAR(50),Department VARCHAR(10), Percentage float)
INSERT INTO @PercentData(Name,department,Percentage)
SELECT 'Gustav','GW',80 UNION ALL
SELECT 'Gustav','NW',20 UNION ALL
SELECT 'Olaf','D',100 UNION ALL
SELECT 'Detlev','NW',50 UNION...
August 20, 2009 at 4:59 am
Dave Ballantyne (8/20/2009)
setlan1983 (8/20/2009)
Just in case where someone changed the entryt.EntryDateTime accidently, need show the record in exit table also.
But WHICH exit row for WHICH entry row ?
Presumably 'Bob' will...
August 20, 2009 at 4:43 am
Just visit the link below to go thru quick tutorial on sql outer joins
August 20, 2009 at 4:30 am
In that case, you may use full outer join as follows:
select
ISNULL(entryt.EmpName,exitt.EmpName) EmpName,
ISNULL(entryt.EntryDateTime,exitt.EntryDateTime) EntryDateTime,
exitt.ExitDateTime
from
dbo.EntryTable entryt
...
August 20, 2009 at 2:51 am
If I'm not wrong sample data may be like this...
create table NodeItem
(NodeID int, ParentNodeID int)
go
insert into NodeItem
select 1 NodeID, null ParentNodeID union all
select 11 , 1111 union all
select...
June 3, 2009 at 11:47 pm
Ok 🙂 Try out this..
SELECT [ScheduleID],ScheduleName
FROM [Schedule]
ORDER BY CAST(CASE
WHEN ScheduleName LIKE '%[0-9][0-9][0-9][0-9][0-9][0-9][0-9]' THEN RIGHT(ScheduleName ,7)
WHEN ScheduleName LIKE '%[0-9][0-9][0-9][0-9][0-9][0-9]' THEN RIGHT(ScheduleName ,6)
WHEN ScheduleName LIKE '%[0-9][0-9][0-9][0-9][0-9]' THEN RIGHT(ScheduleName ,5)
WHEN...
April 9, 2009 at 1:14 am
Hope you're looking for this...
SELECT {ColumnName}
FROM {TableName}
WHERE {ColumnName} LIKE 'Schedule%'
ORDER BY CAST(REPLACE({ColumnName},'Schedule','') AS INT)
April 9, 2009 at 12:39 am
Viewing 7 posts - 1 through 7 (of 7 total)