Viewing 15 posts - 1,951 through 1,965 (of 3,509 total)
Maybe this article?
https://www.simple-talk.com/sql/database-administration/gail-shaws-sql-server-howlers/
May 9, 2016 at 3:21 pm
This is Lynn Pettis' calculation[/url] for first day of the next month...
select dateadd(mm, datediff(mm, 0, @ThisDate) + 1, 0) -- Beginning of next month
last day of the month is the...
May 8, 2016 at 12:15 pm
normal way to post is like this...
SELECT '2016-01-31' AS plant_date
, 4 AS History_Ind
, 3143 AS Prop_Code
, '2016-01-19' AS Void_Start_Date
, '2016-03-14' AS Let_Date
, 'Void' AS Void_Status
UNION ALL
SELECT '2016-02-29',4,3143,'2016-01-19','2016-03-14','CFWD'
UNION ALL
SELECT '2016-03-31',4,3143,'2016-01-19','2016-03-14','CFWD'
UNION...
May 8, 2016 at 6:42 am
This
cast( cast(year(plant_date) as nvarchar(50))+'-'+cast(month(plant_date) as nvarchar(50))+'-1' as datetime) as plant_date
is a calculated column in your Calendar table.
Sounds like you might want to look up Calendar tables. Here's a good...
May 7, 2016 at 10:26 pm
Why not just use a Calendar table... you can use a table-valued function to generate a list of dates on the fly. Then it's just a pure count.
May 7, 2016 at 8:24 pm
A few questions...
1. what's your date format? is that MM-DD-YYYY or DD-MM-YYYY?
2. please explain in English how to get your expected answer. (what does your data mean?)
Another thing... if you...
May 7, 2016 at 1:39 pm
post what you tried. Part of learning SQL is trying something, and failing, learning from your mistake, and trying again.
May 5, 2016 at 6:26 pm
What happens when you run the stored procedure inside SMS, not SSRS? Is there a chance that you're connecting to a different server that has a different copy of...
May 5, 2016 at 5:23 pm
Brandie,
Just wondering... how did you build your machine that you tore apart all the time? A Virtual Machine? I might have to start doing that...
May 5, 2016 at 5:21 pm
The 2004 ALCS must have been one for the record books in your house... You gotta admit, it was a pretty good series - the WS after that was positively...
May 5, 2016 at 12:12 pm
DelimitedSplit8K will do that for you... the code for it is here[/url]:
SELECT *
FROM dbo.DelimitedSplit8K('777777777777777777 0 0 0 0 0 0 0 16090 0 0 0 0 0 0',' ');
The...
May 5, 2016 at 1:58 am
Interesting... Good to know! So check your indexes, then try each one...
Thanks, Scott!
May 4, 2016 at 11:30 am
The code attempts to subtract weekends, holidays...
I would do that part with a Calendar table... then you need pretty much ZERO logic for it.
WHERE Calendar.IsWeekend = False AND Calendar.IsHoliday=False...
May 4, 2016 at 11:25 am
You could... but I'd read this first:
http://sqlinthewild.co.za/index.php/2009/08/17/exists-vs-in/
I would have sworn that EXISTS stops as soon as a True/False changes, while an IN reads the whole table. So I would think...
May 4, 2016 at 11:12 am
Viewing 15 posts - 1,951 through 1,965 (of 3,509 total)