Viewing 9 posts - 16 through 24 (of 24 total)
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...
October 8, 2014 at 4:05 am
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...
October 1, 2014 at 4:36 am
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...
September 30, 2014 at 11:11 pm
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...
September 30, 2014 at 9:37 pm
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) :
--...
September 30, 2014 at 2:41 am
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...
September 30, 2014 at 12:32 am
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...
September 30, 2014 at 12:25 am
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)...
December 28, 2013 at 4:11 am
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...
December 28, 2013 at 3:50 am
Viewing 9 posts - 16 through 24 (of 24 total)