Viewing 15 posts - 61 through 75 (of 898 total)
You can do the same using CROSS APPLY
SELECT S.Batch, S.Account, S.Item, S.Ref, S.PageNo, F.ItemNo
FROM sktrans AS S
CROSS APPLY (
...
May 31, 2016 at 6:16 am
The requirement is not really clear
Can you please clarify it a bit further with some DDL, sample data to test against and the expected results
You can check the link in...
May 18, 2016 at 6:18 am
The requirement is not very clear.
We would need the table structure, some sample data and expected results in a easily consumable format.
That would help us test the solution before giving...
May 3, 2016 at 4:04 am
Something like this...
DECLARE@ShiftScheduler TABLE
(
[Date]DATE,
EmpidINT,
[Shift]TINYINT,
[ShiftType]TINYINT
)
INSERT@ShiftScheduler
SELECT'20140101', 1424, 2, 4 UNION ALL
SELECT'20140102', 1424, 2, 4 UNION ALL
SELECT'20140103', 1424, 2, 4 UNION ALL
SELECT'20140104', 1424, 1, 2 UNION ALL
SELECT'20140101', 1425, 1, 2
SELECTEmpid,
MAX( CASE WHEN DATEPART(...
May 3, 2016 at 3:38 am
You don't need to convert the result of GETDATE() to some VARCHAR value to compare it with a date column. Declare a DATE variable and assign it the value of...
April 2, 2015 at 6:53 am
MarisaG (7/14/2014)
Thank you very much, that's exactly what I was after.
Such a simple way of doing it, but without your help I don't think I could have managed to...
July 14, 2014 at 2:54 am
As a start, you can look up JOINS in Google or Books Online.
Please provide the DDL of both the tables involved and the names of columns you would like to...
July 14, 2014 at 2:53 am
This might help..
SELECT Hole_ID, NAT_East, NAT_North, NAT_RL, Max_Depth, SUM( CASE WHEN Fe_pct > 57 THEN Interval ELSE 0 END ) AS Sum_Intervals
FROM dbo.BCI_Step1_Test
GROUP BY NAT_East, NAT_North, NAT_RL, Max_Depth, Hole_ID
July 14, 2014 at 1:54 am
It would have better if you had provided some more information as the previous posts have suggested.
Anyways, based on the limited information you have provided I think this is what...
July 11, 2014 at 7:22 am
Going by the query that you have provided in your original post, it doesn't look very difficult.
It would be easier for people here to provide you solutions if you give...
July 11, 2014 at 7:00 am
As there was no DDL available , I assumed the DDL based on the first post
DECLARE@Salary TABLE
(
EmpIdINT,
JanNUMERIC(18,2),
FebNUMERIC(18,2),
MarNUMERIC(18,2),
AprNUMERIC(18,2),
MayNUMERIC(18,2),
JunNUMERIC(18,2),
JulNUMERIC(18,2),
AugNUMERIC(18,2),
SepNUMERIC(18,2),
OctNUMERIC(18,2),
NovNUMERIC(18,2),
[Dec]NUMERIC(18,2)
)
INSERT@Salary
VALUES( 1, 100.00, 200.00, 100.00, 200.00, 100.00, 200.00, 100.00, 200.00, 100.00, 200.00, 100.00, 200.00...
July 4, 2014 at 4:32 am
Its not a good table design. Change the design if possible.
Please post some sample data and the DDL of the table involved.
This would help people to come up with good...
July 4, 2014 at 4:18 am
One more way to do the same thing..
SELECTM.parcel, 0 AS [Count]
FROM@m AS M
WHERENOT EXISTS
(
SELECT*
FROM@v AS V
WHEREM.parcel = V.parcel AND V.value > 0
)
July 4, 2014 at 4:01 am
Viewing 15 posts - 61 through 75 (of 898 total)