Forum Replies Created

Viewing 15 posts - 1 through 15 (of 19 total)

  • RE: sum, percent do able ?

    Oh I missed OS . Sorry . Do you have a clue how do i get sum and percent?

  • RE: sum, percent do able ?

    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'...

  • RE: Where between and not between?

    Thanks, I think we can do

    WHERE ((Starttime BETWEEN last2Sunday AND lastSaturday)

    OR

    (Starttime <Last2Sunday AND Endtime > LastSaturday))

  • RE: Where between and not between?

    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 ...

  • RE: How do solve this trick?

    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...

  • RE: How do solve this trick?

    Then i can get something like this

    Location Starttime ...

  • RE: How do solve this trick?

    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

    (

    ...

  • RE: How do solve this trick?

    Now i would like to have the data like this

    Location Starttime ...

  • RE: How do solve this trick?

    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...

  • RE: How do you count percentage?

    Thanks for helping me out. It works with COUNT(DISTINCT Place).

  • RE: How do you count percentage?

    I tried to rename all of them and if we have the list like this

    Animal Duration Place

    cat 420761 ...

  • RE: If ... select ...else then ??

    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 =...

  • RE: If ... select ...else then ??

    Do you mean SQL Server 10.0.4064 ?

  • RE: If ... select ...else then ??

    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...

  • RE: If ... select ...else then ??

    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...

Viewing 15 posts - 1 through 15 (of 19 total)