Viewing 15 posts - 3,376 through 3,390 (of 8,731 total)
Avoid using UNION when you don't want to eliminate duplicates. It's additional work which might generate unexpected results.
Use UNION ALL when you only want to get two sets of data...
February 10, 2016 at 6:09 am
Jeff Moden (2/8/2016)
mxy (2/8/2016)
Thanks it worked let me work on first set of data in the file.Thanks again for your time.
How? When I try to load the file with...
February 8, 2016 at 4:37 pm
Johnny B (2/8/2016)
36 hour day... really?
Sound like a normal day in my previous job. 😀
February 8, 2016 at 3:47 pm
patla4u (2/8/2016)
COALESCE( NULLIF(o.t_wght, 0), x.t_wght, 0)
FROM [TBRTEK002] o
OUTER APPLY (
SELECT TOP 1 max(i.t_wght)...
February 8, 2016 at 3:37 pm
This should work the same way as the code from Jacob. This is the deprecated syntax.
DECLARE @startDateTime DATETIME = '2015-11-01 00:00:00';
DECLARE @endDateTime DATETIME = '2016-02-28 23:59:59';
WITH Sales AS
(
SELECT sales_amount=SUM(AMOUNT),...
February 8, 2016 at 3:33 pm
Trust me, it works the way I posted it with the data file as you posted it.
The first row option doesn't really count rows as you might expect, it counts...
February 8, 2016 at 3:10 pm
patla4u (2/8/2016)
I understood the query but I am not able to return the result. I tried my best to get result. Please help me.
Post what you've tried.
February 8, 2016 at 3:02 pm
Of course it's not working, I made it carry over the weight if the shifts are on the same day. If you are able to understand the query, the correction...
February 8, 2016 at 2:35 pm
Your format file is wrong. You should define the format file according to the data file and map those columns to the table, not the other way around.
10.0
10
1 ...
February 8, 2016 at 2:28 pm
Here's a 2008 friendly option.
SELECT o.*,
COALESCE( NULLIF( o.t_wght, 0), x.t_wght, 0)
FROM [TBRTEK002] o
OUTER APPLY (
...
February 8, 2016 at 1:49 pm
patla4u (2/8/2016)
I am using 2008 R2 and I am not able to run above query. I am sorry.
And why do you post in the 2014 forum? :angry:
February 8, 2016 at 1:44 pm
One way to do it. Assuming I understand correctly.
SELECT *,
COALESCE( NULLIF( t_wght, 0),
NULLIF(...
February 8, 2016 at 1:36 pm
Is it that hard to post the code here?
create table Employees_View
(
ID int,
Name varchar(50),
PayRate float,
PayUnitCode varchar(2),
Commission float
)
insert Employees_View values
(1, 'James', 10,...
February 8, 2016 at 1:13 pm
You provided 276 rows of data. Are you expecting people to check correctness for all those rows? What would be the expected results?
CREATE TABLE [dbo].[TBRTEK002](
[t_mcno] [char](6) NULL,
[t_citg] [char](6) NULL,
[t_trdt] [datetime]...
February 8, 2016 at 12:37 pm
DB Snapshots use the database as the main source of data and only store pages that get modified. That means that querying against the snapshot is probably going to impact...
February 8, 2016 at 11:28 am
Viewing 15 posts - 3,376 through 3,390 (of 8,731 total)