Forum Replies Created

Viewing 15 posts - 61 through 75 (of 394 total)

  • RE: CONVERT and CAST question?

    DECLARE @column varchar(50) = 'user1@email.com';

    SELECT LEFT(@column, CHARINDEX('@', @column, 1) -1);

  • RE: Today's Random Word!

    SQLRNNR (3/4/2015)


    crookj (3/4/2015)


    Ed Wagner (3/4/2015)


    ChrisM@Work (3/4/2015)


    SQLRNNR (3/4/2015)


    toot

    ding

    Ping

    Pong

    Long

    Short

  • RE: Today's Random Word!

    BWFC (3/4/2015)


    Ed Wagner (3/4/2015)


    djj (3/4/2015)


    psingla (3/4/2015)


    Woot!

    Woot!

    Cheer

    Wine

    Vino

  • RE: Update - help

    -- Updating a single-table CTE updates the underlying table, so the change is straightforward:

    -- (Note that you need to order by Amount DESC to ensure the values are in row...

  • RE: SQL NOT IN question

    Try this:

    --==TEST DATA ==--

    use tempdb

    go

    drop table Persons

    drop table Knows

    drop table TakesClasses

    create table Persons (id int, name varchar(50))

    insert into Persons values (1, 'Fred'), (2, 'Bill'), (3, 'Mavis'), (4, 'Arthur'), (5, 'Jill'),...

  • RE: Update - help

    How about this:

    ;WITH CTE AS

    (

    SELECT *, RN = ROW_NUMBER() OVER (PARTITION BY OrderID,ProjectID,ProductID ORDER BY OrderID,ProjectID,ProductID, Amount DESC)

    FROM #projects

    )

    SELECT OrderID

    ,ProjectID

    ,Project

    ,ProductID

    ,Product

    ,Amount = CASE WHEN RN = 1 THEN Amount ELSE 0...

  • RE: Today's Random Word!

    Ed Wagner (3/2/2015)


    laurie-789651 (3/2/2015)


    SQLRNNR (3/2/2015)


    Ed Wagner (3/2/2015)


    crookj (3/2/2015)


    Ed Wagner (3/2/2015)


    TomThomson (3/2/2015)


    Revenant (3/2/2015)


    whereisSQL? (3/2/2015)


    djj (3/2/2015)


    Lynn Pettis (3/2/2015)


    HOME

    Heart

    CardioThorasic

    Trouble

    Tribbles

    Klingon

    Gorn

    Kern

    Jar

    Head

    Beavis

    Homer

  • RE: Today's Random Word!

    SQLRNNR (3/2/2015)


    Ed Wagner (3/2/2015)


    crookj (3/2/2015)


    Ed Wagner (3/2/2015)


    TomThomson (3/2/2015)


    Revenant (3/2/2015)


    whereisSQL? (3/2/2015)


    djj (3/2/2015)


    Lynn Pettis (3/2/2015)


    HOME

    Heart

    CardioThorasic

    Trouble

    Tribbles

    Klingon

    Gorn

    Kern

    Jar

    Head

  • RE: sql query with complex logic

    Hi. You need to provide test data so people can easily test your problem... like this:

    --Here is the following Data Structure of tbltestnew1

    use [tempdb]

    go

    if object_id('tbltestnew1') is not null...

  • RE: Case statement within a where clause - based on 2 variables

    How about this:

    SELECT Customer, [Type], DueDate1, DueDate2 FROM dbo.myTable mt

    WHERE mt.[Type] = @Type

    AND ((@Condition1=1 AND mt.DueDate1 BETWEEN @DueDate1 AND @DueDate2) OR (@Condition1<>1))

    AND ((@Condition2=1 AND mt.DueDate2 BETWEEN @DueDate1 AND @DueDate2) OR...

  • RE: Today's Random Word!

    crookj (3/2/2015)


    Ed Wagner (3/2/2015)


    BWFC (3/2/2015)


    Ed Wagner (3/2/2015)


    Stuart Davies (3/2/2015)


    Ed Wagner (3/1/2015)


    SQLRNNR (2/27/2015)


    clairvoyant

    Clairaudient

    Hokum

    Act

    Parliament

    Government

    Waste

    Rubbish

  • RE: Dynamic connection managers

    If you run the package using DTEXEC, you can change the connections at run time using a parameter (/CONN) - so that might work.

  • RE: Today's Random Word!

    BWFC (2/26/2015)


    laurie-789651 (2/26/2015)


    Stuart Davies (2/26/2015)


    Ed Wagner (2/26/2015)


    BWFC (2/26/2015)


    Ed Wagner (2/26/2015)


    djj (2/26/2015)


    Stuart Davies (2/26/2015)


    BWFC (2/26/2015)


    Capital

    Excellent

    Adventure

    Bill

    Beak

    Peck

    Gregory

    Girl

    Interrrupted

    lunchbreak

  • RE: CONVERTING ACCESS QUERIES TO SQL QUERIES

    Have you got the SQL table definitions?

  • RE: Today's Random Word!

    Stuart Davies (2/26/2015)


    Ed Wagner (2/26/2015)


    BWFC (2/26/2015)


    Ed Wagner (2/26/2015)


    djj (2/26/2015)


    Stuart Davies (2/26/2015)


    BWFC (2/26/2015)


    Capital

    Excellent

    Adventure

    Bill

    Beak

    Peck

    Gregory

    Girl

Viewing 15 posts - 61 through 75 (of 394 total)