Viewing 15 posts - 1 through 15 (of 19 total)
Oh I missed OS . Sorry . Do you have a clue how do i get sum and percent?
May 10, 2012 at 1:50 pm
This one i made up per your team request. I did not test with sandbox ?
CREATE TABLE #Testing
(
Location varchar(255),
OS varchar(255),
Starttime DATETIME,
Endtime DATETIME
)
INSERT INTO #Testing
(Location, Starttime, Endtime)
SELECT 'tampa','win7','2012-05-01 12:56:27.000','2012-05-01 13:39:22.170'...
May 10, 2012 at 1:32 pm
Thanks, I think we can do
WHERE ((Starttime BETWEEN last2Sunday AND lastSaturday)
OR
(Starttime <Last2Sunday AND Endtime > LastSaturday))
May 8, 2012 at 1:49 pm
The result will have
Location Starttime EndTime
Dallas2012-04-29 12:00:00.0002012-05-05 23:59:59.000
San Jose2012-04-29 12:00:00.0002012-05-05 23:59:59.000
San Jose2012-04-30 00:00:00.0002012-05-04 09:51:17.613
San Jose2012-04-30 12:00:00.0002012-05-05 23:59:59.000
San Jose2012-04-29 12:00:00.0002012-05-05 23:59:59.000
Tampa2012-04-29 12:00:00.0002012-04-30 14:23:33.000 ...
May 8, 2012 at 1:05 pm
Sean, this one works
select Location, Starttime, MAX(Endtime)
from #Testing
group by Location, starttime
Lynn, thanks i did not check with yours yet because Sean's
select Location, Starttime, MAX(Endtime)
from #Testing
group by Location, starttime
Worked great.
Thank you...
April 18, 2012 at 4:56 pm
Then i can get something like this
Location Starttime ...
April 18, 2012 at 2:40 pm
What if i have San Jose SELECT 'San Jose','2012-04-10 0:00:00.000','2012-04-15 09:55:12.120'
then it will get only 'San Jose','2012-04-08 0:00:00.000 ??
CREATE TABLE #Testing
(
...
April 18, 2012 at 2:13 pm
Now i would like to have the data like this
Location Starttime ...
April 18, 2012 at 1:40 pm
Sorry, i am newbie and just learned sql from google then use SSMS Express to get data. Is this what i should do per your request?
--===== Create the test table...
April 18, 2012 at 1:11 pm
Thanks for helping me out. It works with COUNT(DISTINCT Place).
April 18, 2012 at 10:11 am
I tried to rename all of them and if we have the list like this
Animal Duration Place
cat 420761 ...
April 17, 2012 at 4:55 pm
Finally I made it works, here are my query
declare @dow int
declare @2SundaysAgo datetime
declare @lastSaturday datetime
select @dow = datepart(dw, getdate())
select @2SundaysAgo = getdate() - (7 + (@dow - 1))
select @lastSaturday =...
March 1, 2012 at 3:47 pm
Oh, i use this SQL Server Management Studio Express 2008 R2 on win7
Microsoft SQL Server Management Studio10.0.1600.22 ((SQL_PreRelease).080709-1414 )
Microsoft Data Access Components (MDAC)6.1.7601.17514 (win7sp1_rtm.101119-1850)
Microsoft MSXML3.0 5.0 6.0
Microsoft Internet Explorer8.0.7601.17514
Microsoft...
March 1, 2012 at 2:27 pm
Sorry, i am newbie and really don't understand what you mean "Please provide some ddl and sample data along with a clear explanation of what you are looking for."
I...
March 1, 2012 at 12:52 pm
Viewing 15 posts - 1 through 15 (of 19 total)