Viewing 15 posts - 601 through 615 (of 1,114 total)
Robert,
Latest code is below.
select Phoneno,
'Cost' = Sum(Cost),
Sum(convert(int,substring(Duration,1,2))) as Hours,
Sum(convert(int,substring(Duration,4,2))) as Minutes,
Sum(convert(int,substring(Duration,7,2))) as Seconds,
'CalculatedSeconds' = case when Sum(convert(int,substring(Duration,7,2))) /60 >= 1
...
July 2, 2008 at 8:14 am
I have tested for some more data.
insert into CallCost
select '9841145768','00:55:00',1
union all
select '9841145768','01:00:05',1
union all
select '9841145768','00:05:00',1
The above code works fine.
Phone Number Cost ...
July 2, 2008 at 8:00 am
Try out this query and let me know.
create table CallCost
(
Phoneno varchar(10),
Duration varchar(15),
Cost numeric(8,2)
)
insert into CallCost
select '9841645768','00:20:15',20
union all
select '9841645768','00:00:15',1
union all
select '9940272484','00:55:01',60
union all
select '9940272484','00:01:15',2
union all
select '9940272484','00:10:15',10
union all
select '9841645768','00:00:55',1
union all
Query:
select Phoneno,
Sum(Cost),
Sum(convert(int,substring(Duration,1,2))) as...
July 2, 2008 at 7:53 am
Jeff,
Heh... this all reminds me of another of my favorite 4 letter acronyms... RTFS!!!!!
what do you mean by RTFS ?
July 2, 2008 at 2:55 am
rbarryyoung,
I am eagerly expecting your article.
June 30, 2008 at 5:30 am
Please don't post the same question twice.
June 27, 2008 at 3:58 am
I never used this kind of coding in my queries.
Jeff,
If you explain a little bit more on rbarry's logic,it would be helpful for me.
CHAR((2*Count(*)) + (CASE Sex When 'M' Then...
June 27, 2008 at 2:39 am
rbarryyoung,
I have executed the part of your query. I am very surprised about your coding skill. Really, it is awesome code.
I just executed the below part only.
Select Name , Age,...
June 26, 2008 at 7:02 am
I have executed the below query, It executed without error message.
declare @strTable varchar(50)
declare @strQuery nvarchar(100)
Select @strTable = '#tmp1'
select @strQuery = 'select * into ' + @strTable + ' from...
June 26, 2008 at 6:11 am
Ahmad,
Try out this one,which is very faster than Loop.
Declare @String varchar(40)
Select @String = 'Tata Consultancy Limited'
select N,substring(@String,N,1)
from Tally
where N <= len(@String)
and substring(@String,N,1) = ''
Output:
N ...
June 26, 2008 at 5:23 am
Thanks Jeff and prabodh.
So far as "vtables" go, are you talking about "Table Variables"?
No.
I understood the difference between =NULL,ISNULL and SET ANSIL NULL ON/OFF after reading the below article.
http://www.sqlservercentral.com/articles/Basic+Querying/understandingthedifferencebetweenisnull/871/
In...
June 26, 2008 at 3:00 am
Viewing 15 posts - 601 through 615 (of 1,114 total)