Viewing 15 posts - 811 through 825 (of 1,248 total)
Are you modifying the view or updating the source tables?
If you're just modifying the results returned in the view, and assuming the the phone column is a varchar the code...
December 2, 2014 at 9:04 am
Fair enough, I was just wondering if'd missed something 🙂 I think that QUOTENAME is going to be something that will make my life easier though.
December 2, 2014 at 8:57 am
select yearMonth
,BariatricSurgery
,BISurgeries
,EDTransfersToBI
,GYNOncProcedures
,GYNOncVisits
,InpatientTransfersToBI
,OPVisitsByBI
,PercentAdmitsFromED
,ThoracicSurgery
from
(
select
YearMonth
,metric
,data
from
dbo.test t
) p
pivot
(
max(data)
for metric
in (
BariatricSurgery
,BISurgeries
,EDTransfersToBI
,GYNOncProcedures
,GYNOncVisits
,InpatientTransfersToBI
,OPVisitsByBI
,PercentAdmitsFromED
,ThoracicSurgery
)
) pvt
A common or garden pivot will do the same too. As a genuine question on...
December 2, 2014 at 8:44 am
If you can post some sample data and examples of what you've already tried it'll be easier to see want you want and give you an answer. Have a...
December 2, 2014 at 3:46 am
I'm really not sure what you mean by 'doing it in one select'. As far as I can see you'll have to check the preceding row in order to...
December 1, 2014 at 7:52 am
This will do what you want but I have assumed that the sample will be taken consistently every minute. If this isn't the case another approach will be needed....
December 1, 2014 at 7:23 am
...it is taken offline i.e. after the stand up.
When an ex-manager of mine told me they's speak to me offline about something I couldn't help help replying that I wasn't...
November 27, 2014 at 7:58 am
In true Columbo fashion, just one more thing...
You could use
AverageHolding= avg([Total Clients Value Holding])
rather than
AverageHolding=sum([Total Clients Value Holding])
/(
Select
COUNT([Fund Code])
from
[#Table]
Where 1=1
and [Client No_] = @client
AND
[Date]...
November 27, 2014 at 5:53 am
You're welcome.
One other thing, be careful using BETWEEN for date range queries. You're usually better using
where
[Date] >= @startdate
and
[Date] <= @enddate
Have a look at this article...
November 27, 2014 at 5:32 am
I've had a second look and you need to declare the length of your @client and @fund variables. If you declare them like so
DECLARE @client as varchar(n)
DECLARE @StartDate as...
November 27, 2014 at 5:01 am
Can you post some sample data please?
What do you mean by 'not working'? I've taken a guess at what your data looks like and I'm getting a 'divide...
November 27, 2014 at 4:53 am
It's a 2008 forum so I took a guess on that 😉
November 27, 2014 at 4:30 am
select
t1.id
,t1.timestamp
,t2.timestamp
,TimeTaken = cast(datediff(second,t1.timestamp,t2.timestamp)/3600 as varchar)+':'
+right('0'+cast(datediff(second,t1.timestamp,t2.timestamp)/60 %60 as varchar),2)+':'
+right('0'+cast(datediff(second,t1.timestamp,t2.timestamp) %60 as varchar),2)
from dbo.runningtime t1
left join dbo.runningtime t2 on t2.id = t1.id+1
Here's another attempt.
@dba-2 From The Cold, I don't mean to...
November 27, 2014 at 4:18 am
Stuart Davies (11/25/2014)
SQLRNNR (11/24/2014)
Stuart Davies (11/24/2014)
SQLRNNR (11/24/2014)
accelerantarson
fun
house
Arrest
November 25, 2014 at 4:56 am
Viewing 15 posts - 811 through 825 (of 1,248 total)