Forum Replies Created

Viewing 15 posts - 241 through 255 (of 479 total)

  • RE: multiple rows in detail table, connected w AND in WHERE clause?

    andrewd.smith (2/6/2009)


    SELECT K.ID_Kandidat, K.Nachname, K.Vorname, B.Berufskuerzel

    FROM tblKandidaten K

    INNER JOIN tblK_Berufsziele B ON (K.ID_Kandidat = B.ID_Kandidat)

    INNER JOIN (

    SELECT K1.ID_Kandidat

    FROM tblKandidaten K1

    INNER JOIN tblK_Berufsziele B1 ON (K1.ID_Kandidat = B1.ID_Kandidat)

    WHERE...

  • RE: multiple rows in detail table, connected w AND in WHERE clause?

    Michael Niemand (2/6/2009)


    Thank you very much, but as I wrote in my initial post, I already discarded this option, because the count of the detail is not limited to 2....

  • RE: multiple rows in detail table, connected w AND in WHERE clause?

    I just read the posts which appeared while I was writing mine

    What I think you need is

    SELECT

    K.ID_Kandidat, Nachname, Vorname

    FROM

    tblKandidaten K LEFT OUTER JOIN tblK_Berufsziele B

    ON K.ID_Kandidat = B.ID_Kandidat

    WHERE...

  • RE: multiple rows in detail table, connected w AND in WHERE clause?

    Michael Niemand (2/6/2009)


    WHERE Berufskuerzel = 'CIMP' AND Berufskuerzel = 'INS'

    -- This of course doesn't work ...

    This is asked for records where Berufskuerzel is equal to both 'CIMP' and 'INS'...

  • RE: Order by

    I don't know where you guys determined that the order was by max rating descending first. Nothing that Judy posted mentioned this.

    My guess, from her examples, was that she...

  • RE: SQL Function : Find ‘X’ Business Days in the Future

    By the way, I would also congratulate anyone who takes the trouble to write an article, even though, in this case, I think that the solution has limited application. In...

  • RE: SQL Function : Find ‘X’ Business Days in the Future

    clifford.wilson (2/4/2009)


    Hi, I have a similar problem to solve regarding contact centre SLAs. However the measure is on the number of hours the call is open. I need...

  • RE: "AND c.customerID IS NULL" makes query run "forever"

    philcruz (2/4/2009)


    Derek Dongray (2/4/2009)


    I appreciate everyone's input on this. (Sorry I couldn't provide sample data but since it concerns customer/email data I can't share it and can't easily generate...

  • RE: Are the posted questions getting worse?

    Bruce W Cassidy (2/4/2009)


    Lynn Pettis (2/4/2009)


    Bruce W Cassidy (2/4/2009)


    Bob Hovious (2/4/2009)


    I just have to blink and be the first to ask.

    Is this thread dead?

    [font="Verdana"]Dunno about the others, but I've been...

  • RE: "AND c.customerID IS NULL" makes query run "forever"

    philcruz (2/4/2009)


    vw_UnsubscribedEmails is

    CREATE VIEW [dbo].[vw_UnsubscribedEmails]

    AS

    SELECT email, dateCreated, source

    FROM dbo.unsubscribedEmails

    UNION

    SELECT email, NULL AS dateCreated,...

  • RE: Date Function

    gary.proctor (2/4/2009)


    This is the way I would do it, but I am sure there are many more ways:

    SELECT CONVERT(CHAR(6),CONVERT(SMALLDATETIME, GETDATE()), 112)

    Bruce W Cassidy (2/4/2009)


    [font="Verdana"]Mine would be:

    selectconvert(varchar(6), getdate(), 112)

    [/font]

    The only thing...

  • RE: Order by

    Could you explain what the result order is? I could make a guess, but would prefer if you stated it before I try to reproduce it.

  • RE: SQL Function : Find ‘X’ Business Days in the Future

    I found it was useful to add a Relative working/business day to the calendar table, thus avoiding the need for the select row_number subquery/CTE.

    And since the hard work is all...

  • RE: Order by

    This works in 2005, don't think it's a new feature... 🙂

    create table #t (r int, b int)

    insert #t values(97,123)

    insert #t values(96,456)

    insert #t values(95,123)

    insert #t values(90,123)

    insert #t values(95,456)

    select r,b from #t...

  • RE: Date Function

    You don't actually need the day...declare @dt varchar(10)

    set @dt = 'AUG2007'

    select year(convert(datetime,@dt))*100+month(convert(datetime,@dt)) as period -- int

    select convert(char(6),Convert(datetime, @dt), 112) as Period -- char(6)

Viewing 15 posts - 241 through 255 (of 479 total)