Forum Replies Created

Viewing 15 posts - 46 through 60 (of 443 total)

  • RE: Get next 1st thursday

    fahey.jonathan (1/24/2012)


    Jonathan,

    Nearly but not quite, that just gets next thursday. Not the next first thursday of the month.

    I misread the original post. I thought the goal was to...

  • RE: Get next 1st thursday

    fahey.jonathan (1/20/2012)


    Here is an alternate version using a Tally table.

    Jonathan,

    Nearly but not quite, that just gets next thursday. Not the next first thursday of the month.

    Here's another version loosely...

  • RE: Get next 1st thursday

    Matt,

    There is however a difference I'd not spotted initially :blush: between the solutions for the 1 Feb 2012

    The original solutions result is: 2 Feb 2012

    Yours is: 1 Mar 2012 :w00t:

  • RE: Get next 1st thursday

    Nice one matt, I thought the original looked well overcomplicated when I saw it.

    thanks

  • RE: Foreign key on an IDENTITY column

    derek.colley (1/17/2012)


    The problem is resolved now, whatever it was. I ran them in the right order so not sure why it borked. There isn't a complete script -...

  • RE: Foreign key on an IDENTITY column

    I see from your error message that the error is on Line 54, maybe there's something causing the issue in the other 40+ lines of your script? Can you post...

  • RE: How to insert multiple rows into a table with identity column

    GilaMonster (1/12/2012)


    ... Personally I think it just drives them away ...

    And it looks he's succeeded! No sign of the OP :crying:

  • RE: Numbers

    Hugo Kornelis (1/4/2012)


    Thanks for the question, Stuart!

    The dollar and pound sign are valid in conversion from string to money or smallmoney (normally followed by the actual amount); the dot is...

  • RE: Using Recursion and Date Tables to Simplify Date Logic

    A situation where the on-the-fly may be useful is when you don't know in advance what range of dates you might need, and don't want 40000+ rows (representing 1-1-1900 to...

  • RE: Using Recursion and Date Tables to Simplify Date Logic

    I use a table valued function which takes two parameters, a start and end date.

    It returns 1 row per day starting on the specified start date up to, but *not*...

  • RE: Using Recursion and Date Tables to Simplify Date Logic

    Another option without using recursion at all:

    ;with Dates as (

    SELECT TOP (DATEDIFF(dd,'20100101','20110101'))

    CalendarDate = DATEADD(dd,ROW_NUMBER() OVER(ORDER BY (SELECT NULL))-1,'20100101')

    FROM sys.columns A, sys.columns B

    )

    SELECT

    ...

  • RE: IsAlphaNumeric

    dUros (12/2/2011)


    I expected function like that. Is string numeric or not.

    There's no need to use a while loop, it's unnecessary!

    You can find non-matches in a string in one line...

  • RE: IsAlphaNumeric

    Aha! I found where you hid it eventually 😀

    There's no need for a loop! What's wrong with PATINDEX for this sort of thing?

    SELECT PATINDEX('%[^A-Za-z0-9 ]%', 'ABC 123')

    SELECT PATINDEX('%[^A-Za-z0-9 ]%', 'ABC*123')

  • RE: IsAlphaNumeric

    But it's still not there Jon ! :w00t:

  • RE: What's Your Title?

    craigB-921010 (11/18/2011)


    Someone asked me what work I was doing for them this week and I said that I'd come to 'polish some turds'. 😉

    Ha, excellent! 😛

    Do you have a power...

Viewing 15 posts - 46 through 60 (of 443 total)