Viewing 15 posts - 5,986 through 6,000 (of 15,381 total)
Something like this?
select *
from YourTable
where Time_Open > dateadd(month, datediff(month, 0, GETDATE()) - 4, 0)
and Time_Open < dateadd(month, datediff(month, 0, GETDATE()) - 1, 0)
--edit--
Fixed a couple typos.
January 9, 2014 at 3:05 pm
Glad that sounds like a plan that will work you. Make sure you test test test!!!
January 9, 2014 at 2:39 pm
PrettyDBA (1/9/2014)
I am attempting to do a rather simple purge task on a very large table. This task will need to take place daily and delete records older...
January 9, 2014 at 2:07 pm
Hi and welcome to the forums!!! It is considered best practice around here to post ddl and sample data in a consumable format. You can read about how to post...
January 9, 2014 at 12:07 pm
Shanmuga Raj (1/9/2014)
Sean Lange (1/9/2014)
I...
January 9, 2014 at 11:57 am
Excellent job posting ddl and sample data. I can't understand what you want for output. I can't seem to figure out the relationship between these tables.
I think that somehow in...
January 9, 2014 at 10:45 am
You would need to use datetime2 for that much precision in the time.
January 9, 2014 at 9:21 am
Yes you have to use a cross tab. If you know the number of elements you can use a static cross tab. If the number of elements is not known...
January 9, 2014 at 7:45 am
NOLOCK is not a good habit at all. In fact query hints in general are a last resort and should only be used when you REALLY understand what they are...
January 9, 2014 at 7:38 am
dwain.c (1/8/2014)
Sean Lange (1/8/2014)
This gets almost what you state you are looking for. It does not return 80, 40 but I can't understand from your data why you think that...
January 9, 2014 at 7:33 am
Your join in the condition is different than the insert statement.
IF EXISTS (SELECT 1 FROM INSERTED I JOIN DELETED D ON I.hMy = D.hMy )
...
January 8, 2014 at 3:45 pm
You are basically describing a classic recursive cte situation but you have a twist in that the recursion can go both directions.
Here is the basic cte.
create table #temp (fileno int,...
January 8, 2014 at 2:43 pm
satishchandra (1/8/2014)
Jeff, Here is the code for split function..
Take a look at the link provided by Jeff above or the same link in my signature about splitting strings. In there...
January 8, 2014 at 2:14 pm
nick 91670 (1/8/2014)
January 8, 2014 at 1:13 pm
Tara-1044200 (1/8/2014)
can you please give me an example how to do that?
To do which one? The SSMS idea is just to use find/replace in the application.
January 8, 2014 at 1:08 pm
Viewing 15 posts - 5,986 through 6,000 (of 15,381 total)