Viewing 15 posts - 61 through 75 (of 155 total)
Lynn Pettis (9/7/2012)
So what you are saying is that BaseStage must be 1 in at least one record of BOTH groups, correct?
Correct.
September 7, 2012 at 12:21 pm
Lynn Pettis (9/7/2012)
Since all you want is the TemplateName where BaseStage is 1 in at least 1 record in a group, the following works:
That is not quite what I want.
I...
September 7, 2012 at 12:20 pm
Hi, I've modified the code:
SELECT Distinct #tblTemplates.TemplateName
FROM #tblTemplates
INNER JOIN #tblBlocks ON #tblTemplates.TemplateID = #tblBlocks.TemplateID
INNER JOIN (SELECT TemplateID, BlockID
...
September 7, 2012 at 12:15 pm
SELECT Distinct #tblTemplates.TemplateName FROM #tblTemplates
INNER JOIN #tblBlocks ON #tblTemplates.TemplateID = #tblBlocks.TemplateID
INNER JOIN (SELECT TemplateID, BlockID
...
September 7, 2012 at 11:54 am
CREATE TABLE #tblTemplates
(
TemplateID int,
TemplateName varchar(50)
...
September 7, 2012 at 11:29 am
Apologies, I was modifying my first post when I thought - that will just confuse the issue. Can we start again please?
CREATE TABLE #tblBlocks
...
September 7, 2012 at 10:18 am
Thanks for your reply ... it's giving me the opposite of what I want because I phrased my question badly.
I have modified my temporary table in my first post to...
September 7, 2012 at 10:09 am
Unfortunately, the 8 or so apps that use this database - which are all timeline driven - don't use a calendar table. In other apps I have a calendar table...
September 6, 2012 at 1:29 pm
Thank you both very much for your help. I was slow replying to Mark to thank him as I was working on the most awful bit of code - using...
September 6, 2012 at 11:09 am
Thank you both for your help.
August 27, 2012 at 3:49 am
Thanks very much for that. Looks great to me.
I've been plodding away all afternoon and ended up with this (don't claim to have come up with it, had some help...
July 31, 2012 at 12:35 pm
One final thing. If the items table contained a date column, how could one force every set of child items to be sorted by date?
CREATE TABLE #tblItems
...
July 31, 2012 at 7:05 am
I'm trying to understand your code ...
In this example your first select statement
SELECT
[Level] = 1,
tr.ParentItemID, tr.ChildItemID,
List = CAST(CAST(tr.ParentItemID AS VARCHAR(10)) + '>' + CAST(tr.ChildItemID AS VARCHAR(10)) AS...
July 31, 2012 at 6:52 am
Apologies - you're right - bit of brain freeze here I guess.
If I sort by List I get:
1>2
1>2>3
1>2>3>6
1>2>3>7
1>2>3>7>10
1>2>3>7>9
1>2>4
1>2>4>8
1>2>5
So, the only niggle is that 1>2>3>7>10 is appearing before 1>2>3>7>9
I've tried this:
;WITH...
July 31, 2012 at 6:08 am
Viewing 15 posts - 61 through 75 (of 155 total)