Forum Replies Created

Viewing 9 posts - 16 through 25 (of 25 total)

  • RE: SSIS Derived Column, Expression Help

    If you want four separate parts :

    First Part:

    SUBSTRING(IP,1,FINDSTRING(IP,".",1) - 1)

    Second Part:

    SUBSTRING(IP,FINDSTRING(IP,".",1) + 1,FINDSTRING(IP,".",2) - FINDSTRING(IP,".",1) - 1)

    Third Part:

    SUBSTRING(IP,FINDSTRING(IP,".",2) + 1,FINDSTRING(IP,".",3) - FINDSTRING(IP,".",2) - 1)

    Fourth Part:

    SUBSTRING(IP,FINDSTRING(IP,".",3) + 1,LEN(IP) - FINDSTRING(IP,".",3))

    If...

    "The price of anything is the amount of life you exchange for it" - Henry David Thoreau
  • RE: Trying to set variable to last day of current month, but seeing NULL instead of 28, 30 or 31?

    ChrisM@Work (10/1/2014)


    Mohit Dhiman (9/30/2014)


    SELECT DATEADD(m,DATEDIFF(m,'19001231',GETDATE()),'19001231')

    This will give you the month end date for the current month (which can be changed by replacing GETDATE() with whichever other month-date you want)..

    And...

    "The price of anything is the amount of life you exchange for it" - Henry David Thoreau
  • RE: Trying to set variable to last day of current month, but seeing NULL instead of 28, 30 or 31?

    DECLARE @currMonthNum INT,

    @lastDayMonth INT

    SET @currMonthNum = DATEPART(MM, GETDATE())

    IF @currMonthNum = (1 | 3 | 5 | 7 | 8 | 10 | 12)

    SET @lastDayMonth = 31

    IF @currMonthNum = 2

    SET @lastDayMonth...

    "The price of anything is the amount of life you exchange for it" - Henry David Thoreau
  • RE: Trying to set variable to last day of current month, but seeing NULL instead of 28, 30 or 31?

    SELECT DATEADD(m,DATEDIFF(m,'19001231',GETDATE()),'19001231')

    This will give you the month end date for the current month (which can be changed by replacing GETDATE() with whichever other month-date you want)..

    And you don't have...

    "The price of anything is the amount of life you exchange for it" - Henry David Thoreau
  • RE: 3 month data count comparison

    Assuming time part is not to be considered and that you need this for only 3 date spans (if you need for more one could Recursive CTE for this) :

    --...

    "The price of anything is the amount of life you exchange for it" - Henry David Thoreau
  • RE: How to get ssns that occures in less than 12 month gap

    Keeping my previous question open , here's one solution to ur problem.

    I came up with this quickly (so there could be better ways of doing it)..

    And again if u're using...

    "The price of anything is the amount of life you exchange for it" - Henry David Thoreau
  • RE: How to get ssns that occures in less than 12 month gap

    I did not get the second scenario.

    Why does (123456789,200R1) have more than one record in 12 month span.

    Considering current month (i.e. September 2014) 12 month span would span uptil September...

    "The price of anything is the amount of life you exchange for it" - Henry David Thoreau
  • RE: Query help: OUTER JOIN with GROUP BY clause

    That's right.

    You need to be careful with OUTER JOINS when applying ON & WHERE conditions.

    Both are filters but ON is applied before Outer rows are added.

    This is the sequence :

    1)...

    "The price of anything is the amount of life you exchange for it" - Henry David Thoreau
  • RE: LIKE - finding ']' or '.' in data

    Luis' solution is right.

    You can always ESCAPE any character you want, just be sure that it does not appear in your string.. "\" in your case ... or you could...

    "The price of anything is the amount of life you exchange for it" - Henry David Thoreau

Viewing 9 posts - 16 through 25 (of 25 total)