Forum Replies Created

Viewing 15 posts - 811 through 825 (of 1,243 total)

  • RE: SQL Query - Simple Question

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

  • RE: Minimal Meetings

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

  • RE: SQL Date Parameters not working

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

  • RE: SQL Date Parameters not working

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

  • RE: SQL Date Parameters not working

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

  • RE: SQL Date Parameters not working

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

  • RE: Calculate previous Date

    It's a 2008 forum so I took a guess on that 😉

  • RE: Calculate previous Date

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

  • RE: Today's Random Word!

    Stuart Davies (11/25/2014)


    SQLRNNR (11/24/2014)


    Stuart Davies (11/24/2014)


    SQLRNNR (11/24/2014)


    accelerant

    arson

    fun

    house

    Arrest

  • RE: Why would you do this?

    Thanks Gail.

    It's hard to ask why they want things because of the dark politics of what's going on. We have to keep things very much at arms length so...

  • RE: Why would you do this?

    I wondered if it's to handle timespans. What we're doing is heavily connected to lengths of time and the duration of various things. I could understand if they...

  • RE: Are the posted questions getting worse?

    HanShi (11/20/2014)


    Stuart Davies (11/20/2014)


    Koen Verbeeck (11/20/2014)


    I have been nominated for the "Author of the Year" award at MSSQLTips.com.

    This means people have to vote for me (or other people, but preferable...

  • RE: Today's Random Word!

    SQLRNNR (11/18/2014)


    dissociative

    fugue

  • RE: MY Data

    I stand corrected. There are several companies that offer pre-employment credit checks over here. The thinking is to avoid the possible corruption. One company also phrases it in...

Viewing 15 posts - 811 through 825 (of 1,243 total)