Viewing 15 posts - 9,571 through 9,585 (of 10,144 total)
Steve Jones - Editor (9/15/2008)
Make sure you don't target any developers with that thing!Thanks again for all the well wishes.
Only property developers Steve, they nick all the best shooting land...
September 15, 2008 at 12:45 pm
jwpquinn (9/15/2008)
Your SQL is correct for the EmpID 2 with only Alogs 4 through 8.
But when I uncomment the code...
September 15, 2008 at 12:44 pm
Is this what you're looking for?
[font="Courier New"]SET DATEFORMAT mdy
DROP TABLE #OVERLAP
CREATE TABLE #OVERLAP
(
ALog INT,
ABegin DATETIME,
AEnd DATETIME,
EmpID CHAR(11),
APercent FLOAT,
PRIMARY KEY (ALog, ABegin, AEnd)
)
INSERT INTO #OVERLAP (ALog, ABegin, AEnd, EmpID, APercent)
SELECT 1,...
September 15, 2008 at 9:46 am
Happy Birthday Mr Jones for when the day comes.
Late November this year I'll be 50. About ten months ago I finally got around to taking up the English longbow after...
September 15, 2008 at 8:18 am
mathewspsimon (9/11/2008)
no PK and Indexes are there.
That pretty much identifies this as a homework question. Rather than solve this for you, here's an article which discusses more than one method...
September 11, 2008 at 4:38 am
Hi Mathew
What do you have in the way of pk / indexes in this table?
Cheers
ChrisM
September 11, 2008 at 4:29 am
Jeff Moden (9/10/2008)
Chris Morris (9/10/2008)
You're welcome, thanks for the feedback.
The number of rows will probably matter if there are hundreds of thousands. If the query runs too slowly (and...
September 11, 2008 at 1:08 am
It works on SQL Server 2k, and I'm pretty sure it will work in SQL Server 2k5 too. This is a SQL Server 2k5 forum section.
September 10, 2008 at 1:37 pm
gpeters (9/10/2008)
Chris Morris (9/10/2008)
I've just run this again, exactly as it appears here...Strange. What type of db are you using?
You first 😉
September 10, 2008 at 10:31 am
If two tally tables makes it too confusing, then one will do at a push. The output of this is the position of the first @, the first and second...
September 10, 2008 at 10:28 am
gpeters (9/10/2008)
Chris Morris (9/10/2008)
There isn't a Function CHAR_LENGTH in my code. Did you copy and paste?Hi. Yes I executed the exact query you supplied.
I've just run this again, exactly...
September 10, 2008 at 10:08 am
There isn't a Function CHAR_LENGTH in my code. Did you copy and paste?
September 10, 2008 at 9:51 am
Or even better - one tally table for each delimiter 😛
[font="Courier New"]DECLARE @holdingAndWeightAndComments VARCHAR(60)
SET @holdingAndWeightAndComments = '@MAGFX~51~Comment1@MALOX~52~Comment2@MAGFX~53~Comment3@'
SELECT n1.number,
n2.number,
CHARINDEX('~', @holdingAndWeightAndComments, n2.number+1),
CHARINDEX('@', @holdingAndWeightAndComments, n1.number+1),
SUBSTRING(@holdingAndWeightAndComments, n1.number+1, n2.number...
September 10, 2008 at 9:49 am
Like this?
[font="Courier New"]DECLARE @holdingAndWeightAndComments VARCHAR(60)
SELECT @holdingAndWeightAndComments = '@MAGFX~50~Comment1@MALOX~50~Comment2@MAGFX~50~Comment3@'
DROP TABLE #hold
SELECT number, '9' AS [ID], --[ID] = IDENTITY(5),
SUBSTRING(@holdingAndWeightAndComments,number+1,
CHARINDEX('@',SUBSTRING(@holdingAndWeightAndComments,number+1,DATALENGTH(@holdingAndWeightAndComments)))-1) AS hold
INTO #hold
FROM Numbers -- Tally Table is a direct replacement of...
September 10, 2008 at 9:02 am
Viewing 15 posts - 9,571 through 9,585 (of 10,144 total)