Forum Replies Created

Viewing 15 posts - 4,066 through 4,080 (of 8,761 total)

  • RE: Joining 2 Tables with Or condition

    Quick suggestion, unpivot the second table and join the results to the first table.

    😎

    create table #test_table_2

    (EmailAddress varchar(100),Email1 varchar(100),Email2 varchar(100))

    INSERT INTO #test_table_1

    SELECT 'c@b.com' as EmailAddress, 'Jack' as FirstName, 'Quick' as...

  • RE: Adios, IE

    IE or Internet Exploiter as it's been known in the security community for years has given so much problems that it in hard start to fathom that problem. The death...

  • RE: get all dates between 2 dates 7 days apart

    Hugo Kornelis (1/9/2016)


    Eirikur Eiriksson (1/9/2016)


    You are very welcome and thanks for the feedback.

    😎

    As demonstrated here, often in-line date tables are easier solutions than physical date tables, especially if they are...

  • RE: get all dates between 2 dates 7 days apart

    You are very welcome and thanks for the feedback.

    😎

    As demonstrated here, often in-line date tables are easier solutions than physical date tables, especially if they are supporting logic rather than...

  • RE: get all dates between 2 dates 7 days apart

    Quick solution

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    DECLARE @START_DATE DATE = CONVERT(DATE,'20100101',112);

    DECLARE @END_DATE DATE = CONVERT(DATE,'20100901',112);

    DECLARE @INTERVAL INT = 14;

    ;WITH T(N) AS (SELECT N FROM (VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) AS...

  • RE: How to rewrite query to be set based

    MyDoggieJessie (1/8/2016)


    Thanks a lot for this, had to create an index on the larger table been hit but it does work well!

    You are very welcome.

    😎

  • RE: Are the posted questions getting worse?

    Luis Cazares (1/8/2016)


    Ed Wagner (1/8/2016)


    Brandie Tarvin (1/8/2016)


    rodjkidd (1/8/2016)


    Brandie Tarvin (1/8/2016)


    Here's a funny. The notification algorithm sent me an email from askssc.sqlservercentral.com telling me that I'd been mentioned in someone's query....

  • RE: Get count of events for each day between 2 dates

    joe-584802 (1/6/2016)


    Thanks Eirikur, that's awesome...!

    Thank you for taking the trouble to give me such a comprehensive example, you've given me another road to go down which I'll pursue.

    You are all...

  • RE: Today's Random Word!

    ChrisM@Work (1/7/2016)


    Grumpy DBA (1/7/2016)


    Ed Wagner (1/7/2016)


    Stuart Davies (1/7/2016)


    Belated?

    Late

    Pregnant

    paws

    Rescue

  • RE: how to audit a table (DML actions) with specific conditions

    neomerdien (1/7/2016)


    Hi,

    looks really good, thanks!

    so just to make sure, i need to replace TBL_TEST_AUDIT with my table and my columns and i cant audit the deletes in question, correct?

    also, im...

  • RE: How to rewrite query to be set based

    Quick suggestion, just make certain that the right indices are in place.

    😎

    /* SELECT GIVING THE DESIRED OUTPUT */

    SELECT

    AC.ID

    ,AC.AcctID

    ,MAX(TT.tpyModifiedDate) AS tpyModifiedDate

    FROM...

  • RE: Row_number partition by specific range of numbers start with int and ends with char

    lsalih (1/6/2016)


    Perfect, it worked like a charm! Now I have one last question to ask: The ultimate goal is after we group the data is to extract each subset of...

  • RE: Get count of events for each day between 2 dates

    Quick solution in line with Jason's suggestion

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    ;WITH SAMPLE_DATA(SD_ID,SD_DATE) AS

    ( SELECT SD_ID,CONVERT(DATE,SD_DATE,120) FROM

    ( VALUES

    ...

  • RE: Averages over 28 days instead of a month

    Jeff Moden (1/5/2016)


    Raastarr (1/4/2016)


    Thanks for all of the responses.

    I've gone with the first solution from Eirikur as [font="Arial Black"]it did exactly what was required [/font]:-).

    Careful now... Does it? With...

  • RE: how to audit a table (DML actions) with specific conditions

    neomerdien (1/6/2016)


    i understand.

    lets say this is my table, so you can use that as a reference:

    TABLE [test1]

    ID [int] NOT NULL,

    ExpDate [datetime] NOT NULL

    i want to log all the deletes from...

Viewing 15 posts - 4,066 through 4,080 (of 8,761 total)