Forum Replies Created

Viewing 15 posts - 3,106 through 3,120 (of 9,715 total)

  • RE: Running report based on current date

    rkl1v09 (8/22/2014)


    Hi Brandie,

    Due date is DATETIME and i am literally just looking for 2 months data.

    Kind Regards,

    R

    Then instead of

    WHERE DATEDIFF(MONTH,a.trans_date,a.due_date) >= 2

    Try

    WHERE a.due_date >= DATEADD(m,-2,CONVERT(DATE,GETDATE(),101))

    This gives you every date...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Compare two columns

    ChrisM@Work (8/22/2014)


    Brandie Tarvin (8/22/2014)


    Chris,

    Why the STUFF() and the XML?

    It's concatenation of values from different rows of the same column, Brandie.

    Split up the email addresses onto different rows, eliminate any...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Compare two columns

    Chris,

    Why the STUFF() and the XML?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Return records that only match set criteria in various tables

    Steve,

    Look at Chris's code carefully, because he makes a point I think you missed. OUTER JOINs don't work as OUTER JOINs when you explicity reference the columns in the WHERE...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Compare two columns

    djj (8/22/2014)


    Brandie Tarvin (8/22/2014)


    lpablo (8/22/2014)


    DECLARE @Email VARCHAR(100)

    DECLARE @Email2 VARCHAR(100)

    Set @email= 'helper@sql-server-helper.com'

    set @email2='fff@dd.com, helper@sql-server-helper.com,vc@.com'

    SELECT case when @email2 like '%'...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Running report based on current date

    Important questions. What data type is DueDate? DATE or DATETIME / SMALLDATETIME?

    If a DATETIME variety, do you need everything from midnight on or are you looking for literally 2...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Compare two columns

    Aaaannnnnddddd... From the theatre of the absurd, I couldn't get PATINDEX() to work, but I did get CHARINDEX() and REPLACE() to work. I don't know why anyone would want to...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Compare two columns

    Myke85 (8/21/2014)


    How I can get 'good'?

    DECLARE @Email VARCHAR(100)

    DECLARE @Email2 VARCHAR(100)

    Set @email= 'helper@sql-server-helper.com'

    set @email2='fff@dd.com, helper@sql-server-helper.com,vc@.com'

    SELECT case when @email like...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Compare two columns

    lpablo (8/22/2014)


    DECLARE @Email VARCHAR(100)

    DECLARE @Email2 VARCHAR(100)

    Set @email= 'helper@sql-server-helper.com'

    set @email2='fff@dd.com, helper@sql-server-helper.com,vc@.com'

    SELECT case when @email2 like '%' + @email1 +...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Add a total column

    Bah... Crosstabs...

    Luis Cazares (8/21/2014)


    Are you seriously taking the advice and code from someone from the internet without testing it?

    Why, yes. Yes I am.

    Luis Cazares (8/21/2014)


    Do you at least understand...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Manually failing over a mirror without access to Primary Server

    Perry Whittle (8/21/2014)


    arnipetursson (8/21/2014)


    One more question.

    If you do not have access to server B beyond db_owner in the database,

    how do you ensure that the logins (server principals) are synced?

    Curious, how...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Manually failing over a mirror without access to Primary Server

    happycat59 (8/21/2014)


    arnipetursson (8/21/2014)


    One more question.

    If you do not have access to server B beyond db_owner in the database,

    how do you ensure that the logins (server principals) are synced?

    As db_owner, you...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Compare two columns<!-- 864 -->

    Myke85 (8/21/2014)


    How I can get 'good'?

    DECLARE @Email VARCHAR(100)

    DECLARE @Email2 VARCHAR(100)

    Set @email= 'helper@sql-server-helper.com'

    set @email2='fff@dd.com, helper@sql-server-helper.com,vc@.com'

    SELECT case when @email like...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Manually failing over a mirror without access to Primary Server<!-- 864 -->

    And that's what happens when I forget how to read a post all the way through. @=)

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • RE: Manually failing over a mirror without access to Primary Server<!-- 864 -->

    On another note, I recently found that I can also just break the mirror from either the primary or the secondary as per this BOL note. So it all depends...

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

Viewing 15 posts - 3,106 through 3,120 (of 9,715 total)