Viewing 15 posts - 421 through 435 (of 4,085 total)
This problem is unsolvable with the information that you have given us. We don't know the logic for whether someone is moving out or moving in and there is nothing...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 13, 2019 at 2:56 pm
DECLARE @MYVAR NVARCHAR(100)
DECLARE MYTESTCURSOR CURSOR
DYNAMIC
FOR
SELECT [name] FROM latest_value
OPEN MYTESTCURSOR
FETCH LAST FROM MYTESTCURSOR INTO @MYVAR
CLOSE MYTESTCURSOR
DEALLOCATE MYTESTCURSOR
SELECT @MYVAR
As has been stated multiple times. The table simply does not contain the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 12, 2019 at 3:47 pm
It was missing parenthesis on the values...this worked.
USE [SSSUTIL]
GO
INSERT INTO [dbo].[RailCarCycleYard]
([RailcarID]
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 11, 2019 at 7:55 pm
my bad..here is the insert again.
I though I was qualifying the field name by prefixing it with the table , I originally tried an alias but that gave me...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 11, 2019 at 4:51 pm
As a style note: LOSE THE BRACKETS. They clutter up the code without adding anything. Obviously there are some cases where you must use the brackets, but those cases are...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 11, 2019 at 4:35 pm
Hope this helps....
Here is the insert I was trying
Insert into [RailCarCycle] ([Railcarid],[StartDate])
select [RailCarid],[LoadDate]
from [RailCarCycleYard]
where [RailCarCycle].[Railcarid] = [RailCarCycleyard].[Railcarid] and [RailCarCycle].[EndDate] is...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 11, 2019 at 4:30 pm
You only answered question 1. You have not addressed the other issues. Specifically note that a list does not qualify as "a create temp table [or declare table variable] and...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 11, 2019 at 4:04 pm
You're missing a bunch of information.
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 11, 2019 at 3:42 pm
When you provide sample data, you should also provide expected results. This helps us compare our tests against what is expected to see how closely we match the expectations. You...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 9, 2019 at 10:32 pm
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 9, 2019 at 8:02 pm
Are you really still on SQL 2008? There is a simple way to do this in SQL 2012 and up, and SQL 2008 is no longer supported.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 6, 2019 at 9:42 pm
Duplicate post. Please respond to this one
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 6, 2019 at 9:41 pm
Without the additional info we can only guess at your full reqirements.
My first 'guess' is as follows
CREATE TABLE #T (Type CHAR(1),Year INT, MOnth CHAR(3), Car VARCHAR(50),...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 6, 2019 at 2:31 pm
SELECTt.COUNTRY_CODE,t.COMPANY_CODE,t.ITEM_NBR,t.Department,t.[Week],d.[Day],q.QTY
FROM t
CROSS JOIN (
VALUES ('SUN'),('MON'),('TUE'),('WED'),('THU'),('FRI'),('SAT')
) d ([Day])
CROSS APPLY (
SELECT CASE d.[Day]
WHEN 'SUN' THEN t.SUN_QTY
WHEN 'MON' THEN t.MON_QTY
WHEN 'TUE' THEN t.TUE_QTY
WHEN 'WED' THEN t.WED_QTY
WHEN 'THU' THEN t.THU_QTY
WHEN...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 4, 2019 at 6:23 pm
What have you tried?
A few things to think about. When you note that something is in more than one country, you're considering that it has appeared in more than...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 4, 2019 at 2:45 pm
Viewing 15 posts - 421 through 435 (of 4,085 total)