Viewing 15 posts - 151 through 165 (of 5,503 total)
This link might help you to answer your question.
Side note: the answer is based on the tone of the question...
August 3, 2014 at 3:51 am
Please provide table definition and sample data leading to your expected result in a ready to use format as described in the first link in my signature.
Also, please include what...
August 3, 2014 at 3:29 am
I can't reproduce the error you're getting:
create table #t (EmpID char(5), Name varchar(10), WorkDate date,Status varchar(1),WkdHrs int)
insert into #t
values
('00010', 'JOSEPH', '20140710','P', 8),
('05200', 'ANTHONY', '20140710','P', 8),
('35359', 'OMEGA', '20140710', Null, 0)
SELECT EmpID,...
August 3, 2014 at 3:24 am
Here's one way to do it:
with cte as
(
-- UNPIVOT the two columns
SELECT inside
FROM logs
UNION
SELECT outside
FROM logs
UNION
-- add the start time
SELECT DATEADD(dd,DATEDIFF(dd,0,MIN(inside)),0)
FROM logs
UNION
-- add the end time
SELECT DATEADD(dd,DATEDIFF(dd,0,MAX(inside)),1)
FROM logs
), cte2...
August 3, 2014 at 3:18 am
Please have a look at the CroosTab article referenced in my signature.
Get back to us if you still have questions.
August 2, 2014 at 12:59 pm
duplicate post. No replies please.
Please see the Original post
August 2, 2014 at 12:55 pm
at ZZartin:
Pleae run your code with the following line at the very beginning:
SET DATEFIRST 4
Strong hint: DATEFIRST is not deterministic...
July 30, 2014 at 3:53 pm
I don't really understand why "product per lin within a plant" would be end up as a cross join.
Based on your example you have two rows provided:
INSERT INTO [dbo].[Resource_Mat] ([Plant],...
July 30, 2014 at 3:49 pm
You might want to be a little more specific what you mean by
should not get displayed
...
If you run the "outer" sproc in SSMS, any result set being...
July 28, 2014 at 10:48 am
thejordans21 (7/28/2014)
July 28, 2014 at 10:43 am
Once we have sample data to work with it should be a straight forward approach.
It looks like you're looking for the setup time per resource and product.
If that's the case...
July 27, 2014 at 8:14 am
Are all the tables used in the Join located at the Orcle server?
If so, I recommend to change it to a remote Query (at least for all tables located at...
July 27, 2014 at 4:58 am
Based on Eirikurs great solution I added a few minor "enhancements":
a) instead of using GETDATE() in a CASE statement, I've added a separat variable. This has two advantages: it makes...
July 27, 2014 at 2:15 am
Instead of
Union
If(@NPI is not null or @TIN IS Not null)
Begin
You'll need to remove the If condition as well as the BEGIN ... END.
Add the following line to the WHERE...
July 27, 2014 at 1:22 am
mallikachowdhary 98955 (7/26/2014)
As I mentioned in my earlier post while running with OpenQuery gives me the following error:
The OLE DB provider "SAOLEDB.11" for linked server "ENIQSQLSERVER" supplied inconsistent metadata. The...
July 26, 2014 at 11:44 am
Viewing 15 posts - 151 through 165 (of 5,503 total)