Viewing 15 posts - 1,141 through 1,155 (of 3,544 total)
pdonley (4/1/2011)
Wait, I think I'm on to something. A little more messing around here oughta fix it.
If you still having probs then by all means attach the 700 rows as...
Far away is close at hand in the images of elsewhere.
Anon.
April 1, 2011 at 6:44 am
WITH a (NMI,StartDate,ID,[Desc],EndDate,RowNum) AS (
SELECTNMI,StartDate,ID,[Desc],EndDate,ROW_NUMBER() OVER (ORDER BY NMI,StartDate) AS [RowNum]
FROMTempTest
)
SELECT a.NMI,a.StartDate,a.ID,a.[Desc],a.EndDate,a.RowNum,b.StartDate AS [NextStartDate],b.EndDate As [NextEndDate]
FROM a
LEFT JOIN a b ON b.NMI=a.NMI AND b.RowNum=a.RowNum+1
Far away is close at hand in the images of elsewhere.
Anon.
April 1, 2011 at 6:40 am
Can you post the data you used?
Far away is close at hand in the images of elsewhere.
Anon.
April 1, 2011 at 6:22 am
Craig Farrell (3/31/2011)[hrI like the glass idea. I wonder if that's feasible in price for a home office... hmmmmm....
Yeah and you could go outside and the solution would look...
Far away is close at hand in the images of elsewhere.
Anon.
March 31, 2011 at 6:05 pm
CirquedeSQLeil (3/31/2011)[hrHa - why stop there. I plan on working on SQL Server 2210 (you know when the file system be run by the DBMS).
Meh! By then it will...
Far away is close at hand in the images of elsewhere.
Anon.
March 31, 2011 at 6:01 pm
OK try replacing WHERE line with
WHERE timestampCompleted >= DATEADD(hour,6,DATEADD(minute,30,@startDate))
Far away is close at hand in the images of elsewhere.
Anon.
March 31, 2011 at 5:49 pm
Sorry error in Day calc
Try the posted code now.
Far away is close at hand in the images of elsewhere.
Anon.
March 31, 2011 at 10:08 am
Try replacing
CAST(timestampCompleted as TIME)
to
CONVERT(char(8),timestampCompleted,108)
Far away is close at hand in the images of elsewhere.
Anon.
March 31, 2011 at 9:42 am
Changed the code add FROM clause
Far away is close at hand in the images of elsewhere.
Anon.
March 31, 2011 at 9:33 am
pdonley (3/31/2011)
I'm getting a syntax error on that one inside the SUM() functions. THEN ELSE END...it says incorrect syntax near the keyword "ELSE"
Sorry my bad :blush:
Was in a hurry and...
Far away is close at hand in the images of elsewhere.
Anon.
March 31, 2011 at 9:27 am
DECLARE @startDate datetime;
SET @startDate = '2011-03-01 00:00:00.000';
DECLARE @endDate datetime;
SET @endDate = '2011-03-03 00:00:00.000';
SELECT [Day],
SUM(CASE WHEN [Type]='T' AND Shift=1 THEN 1 ELSE...
Far away is close at hand in the images of elsewhere.
Anon.
March 31, 2011 at 9:18 am
If I understand you correctly then you cannot have a single ID in your third table as a FK to two other tables (predios & fogos) unless the ID exists...
Far away is close at hand in the images of elsewhere.
Anon.
March 31, 2011 at 8:18 am
To do this you will have to use dynamic sql, ie
DECLARE @sql varchar(500)
SET @sql = 'select * from OPENQUERY(XHMNDGHFYUHFGHJFFRJF,''select {[Employee].[Dept].[Dept]*[Employee].[Empno].[Empno]} on 1,[Measures].[Salary] on 0 from [Employee] where [Employee].[Empname].&'+@name+''')'
EXEC (@sql)
Far away is close at hand in the images of elsewhere.
Anon.
March 31, 2011 at 6:43 am
You're welcome 🙂
Far away is close at hand in the images of elsewhere.
Anon.
March 30, 2011 at 8:33 am
The patindex is checking for two chars _ and space
charindex('_', @a) will return position of first _ char
patindex('%[ _]%', @a) will return position of EITHER _ or space
charindex('_', @a) and...
Far away is close at hand in the images of elsewhere.
Anon.
March 30, 2011 at 7:08 am
Viewing 15 posts - 1,141 through 1,155 (of 3,544 total)