Viewing 15 posts - 211 through 225 (of 334 total)
I'm sure you can clean this up but it will do what you want.
; with cte
as
(select d.idxmrn, d.dischargedate, a.apptdt2, DATEDIFF(d,d.dischargedate, a.apptdt2) daysSince, ROW_NUMBER() over (PARTITION by d.idxmrn order by...
February 25, 2013 at 2:11 pm
SCOPE_IDENTITY() returns the identity value generated in the table in the current session.
ie., I would assume that each time you call the procedure it would be a new session and...
February 25, 2013 at 11:18 am
This might be a good place to start. It's server specific but it might give you some ideas about what to look at.
http://technet.microsoft.com/en-us/library/ff898403(v=sql.105).aspx
February 25, 2013 at 10:55 am
Maybe consider vertical partitioning and recreate in a view?
February 25, 2013 at 10:08 am
I've done the same thing using the more generic Tally or Numbers table.
Here's a good article by Jeff about it.
February 22, 2013 at 8:29 am
Was this by chance originally a SQL 2000 database?
February 20, 2013 at 3:51 pm
What was the trick, just in case one of us accidentally does the same thing?
February 20, 2013 at 1:34 pm
Wrap the whole thing in another select and get your min and max values.
February 20, 2013 at 1:17 pm
*bump* Really? Has no one ever tried to do this?
February 20, 2013 at 9:49 am
Nevermind. I found the solution was to put it in a list box.
February 15, 2013 at 2:17 pm
Hey Antonio, have a look at this article by Greg Larson.
http://www.simple-talk.com/sql/learn-sql-server/building-my-first-sql-server-2005-clr/
February 15, 2013 at 8:25 am
Perhaps something like this would put you on ther right track?
select sum(calls) calls, sum(answered) answered, sum(missed) missed
from
(
select case when call = 'anon' then 0 else 1 end as calls
, case...
February 14, 2013 at 1:57 pm
Looks like you need to add @fiscalstart datetime to your procedure parameter block
February 14, 2013 at 1:05 pm
Viewing 15 posts - 211 through 225 (of 334 total)