Viewing 15 posts - 2,251 through 2,265 (of 10,144 total)
dineshhp (8/19/2015)
I have a table Test123 having three column EmpID,AttribName,AttribValue.
Please run the below query to generate table structure and data.
Create Table Test123(EmpID int,AttribName varchar(50),AttribValue varchar(50))
insert into Test123 values(1,'Name','X')
insert...
August 19, 2015 at 1:53 am
serviceaellis (8/18/2015)
The worksheet is the result that needs to be produced with the highlighted row.
in the Access file the two tables are:
1. PersonMembership - with all the membership...
August 19, 2015 at 1:27 am
maxlezious (8/18/2015)
Thank you so much for the updated query Chris. That's is exactly what I was after, really appreciate your time and help with the query.
You're welcome. Sample data, a...
August 19, 2015 at 1:25 am
Sure - try this:
SELECT
h.[hours],
a.ActType,
Activities = COUNT(a.ActType),
Points = COUNT(*) * x.points
FROM #tblActivities a
CROSS APPLY (
SELECT
[hours] = CASE
WHEN a.ActType = 'Motion' THEN DATEPART(HOUR, a.isoTimeStamp)
WHEN a.ActType =...
August 18, 2015 at 10:28 am
Here's a halfway point:
SELECT
a.*,
x.[hours],
Points = COUNT(*) OVER(PARTITION BY a.ActType, x.[hours]) * x.points
FROM #tblActivities a
CROSS APPLY (
SELECT
[hours] = CASE
WHEN a.ActType = 'Motion' THEN DATEPART(HOUR, a.isoTimeStamp)
WHEN...
August 18, 2015 at 8:58 am
Excellent job on putting together sample data. Can you post up what you expect your output to look like? Cheers.
August 18, 2015 at 8:42 am
serviceaellis (8/18/2015)
It should show 2015 AND a null row like ClubNo 8004
So neither solutions are showing ClubNo 5305 null row like ClubNo 8004.
Only...
August 18, 2015 at 8:31 am
serviceaellis (8/18/2015)
however ...
ChrisM@Work,
yours is showing 2014.
and both are not showing ClubNo 5305 with a null membership info like ClubNo 8004.
NOTE: 5305 has memberships in 2015 and prior...
August 18, 2015 at 8:10 am
djj (8/18/2015)
Ed Wagner (8/17/2015)
Luis Cazares (8/17/2015)
whereisSQL? (8/17/2015)
Eirikur Eiriksson (8/17/2015)
Ed Wagner (8/17/2015)
eccentricDBA (8/17/2015)
whereisSQL? (8/17/2015)
DonlSimpson (8/17/2015)
OptimizerCost-based
low-cost provider strategy
Low Quality
WYPIWYG
Consultant
Contractor
Temp
Intern
Affairs
August 18, 2015 at 7:58 am
Try this:
SELECT
TE.JobID,
TotalDistanceTravelled as Distance,-- what table is this from?
TotalTripFare AS TotalFare -- what table is this from?
FROM [sqlcdscluster\sqlcds].cdsbusiness.dbo.Tbljobbooking MW
INNER remote JOIN dbo.tbltripenddetail TE
ON MW.JobID = TE.jobID
AND...
August 18, 2015 at 6:59 am
born2achieve (8/18/2015)
Hi Chris,Sorry, Am not sure whats wrong in the test data. Please help me on understanding what wrong in test data.
Hi Eirik,
Thanks for your sample.
You say "@Process table data,...
August 18, 2015 at 6:08 am
born2achieve (8/18/2015)
Hi Chris,Thanks for your reply and @Process and at @steps are two tables.
select ProcessName,S.Stepname as parent,S.stepname as child from @Process P join @steps S.......any suggestions and sample please
In...
August 18, 2015 at 5:56 am
born2achieve (8/18/2015)
Sample data to play with,
declare @Process table(ProcessId int identity(1,1) primary key,ProcessName varchar(100),ParentStep int, ChildStep int);
Insert into @Process(ProcessName,ParentStep,ChildStep)
select 'Process1',1,2 union all
select 'Process2',1,3 union all
select 'Process3',1,6 union all
select 'Process4',4,2 union all
select...
August 18, 2015 at 5:39 am
-- This has become more or less the gold standard method
-- for avoiding the division by zero error:
SELECT
i.CPSP35,
i.VINT35,
ISNULL(i.CPSP35 / NULLIF(i.VINT35,0),0) AS High
FROM dbo.SSCCWorderExtract e
INNER JOIN DEV.dbo.INP35 i
ON...
August 18, 2015 at 2:02 am
Viewing 15 posts - 2,251 through 2,265 (of 10,144 total)