Viewing 15 posts - 211 through 225 (of 748 total)
This is driving people crazy!
There is another sp to be converted and this sp contains loop and lots of calculation. The original sp is working fine and logic is very...
April 11, 2014 at 1:47 pm
thank you so much for your quick reply, other than you forgot the End for the Case, it's working perfectly.
April 11, 2014 at 10:25 am
That was quick and simple, thank you.
April 8, 2014 at 12:56 pm
dbalmf (3/25/2014)
My Take on it.. 🙂
WITH DocCTE (DivIDCte, DivIDCount)
AS
(SELECT DivID,
COUNT(DivID)
FROM Doc GROUP BY DivID)
SELECTID,
Div,
'Count' =...
March 25, 2014 at 10:54 am
RTaylor2208 (3/25/2014)
Can you provide a sample output of what you would expect given your data? I am struggling to understand what data you want returned.
I am looking for an...
March 25, 2014 at 10:30 am
Jeff Moden (3/17/2014)
halifaxdal (3/17/2014)
CROSS APPLY( VALUES(1, SUBSTRING(d.Category, 1,...
March 17, 2014 at 1:14 pm
Too bad! Only beautifully working on my local 2k8, when I run it on server 2k5, it fails with the term "VALUES"
CROSS APPLY( VALUES(1, SUBSTRING(d.Category, 1, 1)),
is VALUES new...
March 17, 2014 at 12:37 pm
Beautifully working!!! Thank you so much.
March 14, 2014 at 4:40 pm
Bingo!
Temp table doesn't have that restriction! All I need to do is to create temp table instead of a static table
February 28, 2014 at 2:03 pm
Hello, I finally end up with the following code which is working as expected:
ALTER PROC ddGetDevStatsByUnitStateAndYear (@Unit varchar(20), @State varchar(10), @Year int)
AS
IF @State = 'All'
BEGIN
IF @Year = 0
BEGIN
SELECT...
February 28, 2014 at 1:39 pm
Thanks for reply, maybe I didn't make it clearer, I decided to go this way:
ALTER PROC ddGetDevStatsByUnitStateAndYear (@Unit varchar(20), @State varchar(10), @Year int)
AS
IF @Year = 0
BEGIN
SELECT Unit = isnull(i.Division,...
February 28, 2014 at 12:34 pm
Steve Jones - SSC Editor (2/28/2014)
DECLARE...
February 28, 2014 at 11:45 am
Will this works?
((@Year = (Case @State When 'Open' Then CAST(YEAR(DateFirstIssued) AS int) When 'Closed' Then CAST(YEAR(RetiredDate) AS int) Else @Year End ) and @Year > 0) or
(@Year = 0 ))
February 28, 2014 at 11:18 am
Isnull won't work in my case as the where clause doesn't return any record.
I ended up using
if not exists (select ....)
insert into
select.....
insert into
select 0,0....
But I believe there...
February 25, 2014 at 10:51 am
Things getting complicated now:
The script help me get the sum for the specific reporting period, now I am asked to include the ""so far" sum:
for example, currently the script will...
February 24, 2014 at 11:56 am
Viewing 15 posts - 211 through 225 (of 748 total)