Forum Replies Created

Viewing 15 posts - 2,341 through 2,355 (of 3,544 total)

  • RE: String Tokening

    Or this

    SELECT LEFT(@Input,PATINDEX('%[^0-9]%',@Input+'Z')-1)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: String Tokening

    Not aware of a function, per se but you could try this

    SELECT CASE WHEN PATINDEX('%[^0-9]%',[Input])>0

    THEN LEFT([Input],PATINDEX('%[^0-9]%',[Input])-1)

    ELSE [Input]

    END

     

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: query result as header row

    Always best done in presentation (app) but if you truly want to do it in sql then

    DECLARE @maxemp int, @maxman int, @count int,@managerid int, @sql varchar(1000)

    SELECT @maxemp = COUNT(DISTINCT...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Question about query and pivot. Please help!

    SELECT t1.EmpID, t1.PayCode, t1.PayAmt, t2.PayCode, t2.PayAmt

    FROM #table t1

    INNER JOIN #table t2

    ON t2.EmpID = t1.EmpID

    AND t2.PayCode = 2

    AND t2.PayAmt <> (t1.PayAmt * 1.5)

    WHERE t1.PayCode =...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Converting textual dates to actual dates

    It does not matter if OpeningDate is NULL or '', CONVERT will not produce the error (you will get NULL for NULL date and '1900-01-01' for '')

    The error is due...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Question of the Day for 11 Mar 2005

    Search the Internet there is a lot about this.

    This may help

    http://www.dbazine.com/celko1.html

    This is lifted from a page on the Internet

    DivideBy:

    You may also perform a set division operation on two tables....

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Question of the Day for 11 Mar 2005

    mmmm different

    Nice deviation from the norm

    DIVIDEBY is not a SQL operator or command, it is algebra

    I...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SQL Help

    Duplicate post.

    See http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=166820

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SQL Help

    Not sure if this is what you want. It all depends on what you want to do with the data from the additonal tables.

    LEFT OUTER JOIN E__EMPLOYEE e

    ON [result].EMPLOYEEID...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Retrieving data from a postcode string

    Yes, if there is no space then it makes it difficult to split. There is another thread on this forum that discusses this topic and I think it assumes that the...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Retrieving data from a postcode string

    SELECT LEFT(@postcode,CHARINDEX(' ',@postcode)-1)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: contains(co1, col2)

    Phill is right you will have to use either a string or a variable you cannot use another column in CONTAINS.

    The error is in the first line as not tablename...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Converting Float to decimal(5,1)

    The use of float aside, I think there is a problem with your statement.

    If you are converting numeric(5,1) to float then you will get either an exact value or an...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Retrieving data from a postcode string

    A bit late, but....

    SELECT LEFT(@inputstring,PATINDEX('%[0-9]%',@inputstring)-1)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SQL Bulk Insert - using " to wrap text fields

    I can't get it to work at all

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 2,341 through 2,355 (of 3,544 total)