Viewing 15 posts - 2,446 through 2,460 (of 5,843 total)
CASE WHEN @money < 0 THEN '(' + CAST(@money AS varchar(20)) + ')' ELSE CAST(@money AS varchar(20)) END
August 21, 2013 at 12:08 pm
CRAP!! I went backwards!! Just a sec and I will have a fix ...
August 21, 2013 at 12:04 pm
It can ABSOLUTELY make a difference, depending on the ANSI_PADDING setting for the columns when you created the table. If it is ON and you insert data that has...
August 21, 2013 at 8:20 am
Please provide table create script(s) (with indexes if any), sample data to put in said table(s), and expected output from your code.
August 19, 2013 at 2:44 pm
T.Ashish (8/18/2013)
I was trying to use partitioned index for a slow query but I was stopped with following response...
August 19, 2013 at 7:45 am
OP is a new user. I already PM'd them back about that. Hopefully they will post up on this thread.
August 17, 2013 at 1:25 pm
Please provide table create scripts with sample data and expected output and we can write a query to assist. Enable us to help you...
August 17, 2013 at 11:39 am
jethrow (8/17/2013)
Another option:
SELECTname, CASEWHEN Mark1>Mark2 AND Mark1>Mark3 THEN 'Mark1'
WHEN Mark2>Mark3 THEN 'Mark2'
ELSE 'Mark3' END
FROMSample;
CASE: My favorite 4-letter TSQL word!! 😎
August 17, 2013 at 11:37 am
What you seek to do is literally impossible without some identification of the type of date format provided. The reason is that you can have a at least 2...
August 16, 2013 at 4:15 pm
I would imagine that your query references VIEWS given the naming scheme, meaning we have no idea what is going on in your code. To have much hope of...
August 16, 2013 at 4:10 pm
Glad we found some improvements. There are still quite a few things to check, but I think though that anything more will be beyond the capabilities of a forum...
August 15, 2013 at 2:13 pm
Something like this, although again you have provided very limited data.
;WITH a AS (
SELECT agentid, 'Open' AS ExceptCodeDetailName, Detail_Start_Time,
Detail_End_Time, ROW_NUMBER() OVER (order by AgentID, Detail_End_Time, Detail_Start_Time) AS rownum
FROM @testing)
SELECT a1.agentid,...
August 13, 2013 at 4:01 pm
Given that you are on SQL 2012, here is one solution that uses the new Windowing Functions:
;WITH a AS (
SELECT agentid, 'Open' AS ExceptCodeDetailName,
Detail_End_Time AS Detail_Start_Time,
LEAD(Detail_Start_Time,1,NULL) OVER (order by...
August 13, 2013 at 11:25 am
Viewing 15 posts - 2,446 through 2,460 (of 5,843 total)