Forum Replies Created

Viewing 12 posts - 31 through 42 (of 42 total)

  • RE: Get First row value

    Yes, does my solution (bottom pg 3) work or not?

  • RE: Excluding in a query with multiple conditions?

    Select {col1, Col2, ...Coln} From {Table}

    Where NOT (Department = 2 And Category2 = 'B')

    And NOT (Department = 2 And Category3 = 'C')

    And NOT (Department = 3 And Category1 =...

  • RE: User Defined Function Execution

    Hmm I know exactly how UDF's work given that I write/use them but this question must have been worded really badly (for me).

    "SELECT UDF FROM Table" - to me this...

  • RE: ORDER BY

    Works fine in SQL2000.. you'd get the start date column twice (once at start, once wherever it naturally sits in the order of columns on the table.. and order by...

  • RE: Get First row value

    If you can make the assumption "Smallest MID is always the 'first' row for each code" then this should work:

    -- Using MID (assumption: Smallest ID = "first")

    SELECT PD.Code,

    PD.Remarks,

    E.Status

    FROMPDetails PD

    INNER...

  • RE: COUNT and NULL

    No problem at all - glad I could help 🙂

  • RE: Ordereing an IP address

    Derek Dongray (4/30/2008)


    janine.rawnsley (4/30/2008)


    The table variable is only created for demo purposes..

    Just use ORDER BY CAST(replace (IPAddr,'.','') as int)

    No, because this would place '192.1.1.1' before '19.2.1.12'.

    Also addresses like '192.168.123.234'...

  • RE: Ordereing an IP address

    The table variable is only created for demo purposes..

    Just use ORDER BY CAST(replace (IPAddr,'.','') as int)

  • RE: Ordereing an IP address

    Tell me I'm wrong.. if I am.. but isn't this the simplest way?

    -===== Create a table to demo with

    DECLARE @DemoTable TABLE (IPAddr VARCHAR(15))

    INSERT INTO @DemoTable (IPAddr)

    SELECT '192.168.215.1' UNION...

  • RE: SELECT MIN and MAX Date for eacy day in a month range

    Well, since you appear to only be running it for a month at a time, why not simplify it and use DATEPART in your grouping?

    SELECTUser_ID,

    MIN(add_date) as 'First Log',

    MAX(add_date) as 'Last...

  • RE: COUNT and NULL

    I've made a few assumptions hence my larger query:

    1, You won't always have a job within a category with a create date or filled date that falls within the desired...

  • RE: COUNT and NULL

    If I'm understanding your requirement correctly, something like this? Sorry if I've over-complicated but I'm trying to cater for all possible scanrios here (including there being no jobs at all...

Viewing 12 posts - 31 through 42 (of 42 total)