Viewing 7 posts - 16 through 22 (of 22 total)
Never mind, I figured it out.
select AVG(days)
from
(select datediff(dd, min(sc.transDate), max(sc.transDate)) as days
from detail sc
inner join header sm on sm.ID = sc.ID where sm.status = 'CLOSED'
group by sm.ID) tblTemp
Thanks
May 15, 2007 at 7:32 am
Thank you all for great improvements, it's been a great learning experience.
Thanks
Allen
April 28, 2007 at 7:25 am
Here most of the sp. I left a little bit out, I'm creating two different cust no's, one has to start with a M, they both have different starting places...
April 27, 2007 at 4:29 pm
Thanks PW, I've rewritten it to be set based, plus now its much simplier.
CREATE TRIGGER UPD_CUST_PART ON dbo.data
FOR INSERT
AS
BEGIN
UPDATE data
SET custpart =
left(RIGHT(LEFT(cast(s.textfld as varchar(500)),(CHARINDEX(CHAR(13),cast(s.textfld as varchar(500)))-1)),((CHARINDEX(CHAR(13),CAST(s.textfld as varchar(500)))-1)-15)),25)
...
August 25, 2006 at 8:46 am
OK, I think I understand the updating part.
At this time they will be single transactions, but you never know about the future. How would you do a set based...
August 24, 2006 at 2:50 pm
Thanks Jon.
Would it also be possible, to create a distributed query on to the linked server and use that in a view on SQL 2005. And then in turn use...
May 31, 2006 at 7:43 am
Viewing 7 posts - 16 through 22 (of 22 total)