Forum Replies Created

Viewing 15 posts - 61 through 75 (of 144 total)

  • RE: Generate Month Day Table Variable

    As strange as this sounds, yes, I think. I am working on a report to compare revenue from month to month and the users want to know where they...

  • RE: Figure out end date from next record

    Thanks. This did the trick.

  • RE: Cross Tab or Pivot Question

    It works. I didn't add in the calculated column and try that yet but I'm not finding huge performance differences between both methods. Now, I've only timed the...

  • RE: Cross Tab or Pivot Question

    I misspoke. The seconds were off so I am converting to minutes. Same concern exists though.

  • RE: Cross Tab or Pivot Question

    Here is where I'm at:

    DECLARE @start_date datetime,

    @weeks int

    SET @start_date = '10/31/2007'

    SELECT @start_date = dateadd(day, 2, dateadd(day, -1 * datepart(weekday, @start_date), @start_date))

    SET @weeks = 12

    SELECT DATEADD(dd, (n.Num-1) * 7, @start_date)...

  • RE: Cross Tab or Pivot Question

    Another issue I just ran accross and am looking at resolving is that there is another table we use called op_owner. What we do in that table is track...

  • RE: Cross Tab or Pivot Question

    Thanks GSquared. I've got the rep in there now and am just doing some validity checks to see if I agree with the numbers. I am then going...

  • RE: Cross Tab or Pivot Question

    I'll try what you are suggesting on the beginning date. As far as adding the sales_owner do you have any advice on how to do that. I can't...

  • RE: Determine Average Time between dates

    Thanks Mark. That worked. Just had to make one change because in some instances there was no time between calls because of conferencing. Here is the result:

    SELECT...

  • RE: Determine Average Time between dates

    Thanks. Based on your input and help, this is what does the trick for the sample data:

    SELECT stime.phoneuser,

    CAST(AVG(CAST((DATEDIFF(ss, DATEADD(ss, stime.duration_seconds, stime.origdate), etime.origdate))AS DECIMAL(10,2)) /60) AS DECIMAL(10,2))

    FROM #avetime stime...

  • RE: Determine Average Time between dates

    By using this revised test data, even when you run the first query from Samuel it is not including everything for Dolan and I can't figure out why.

    CREATE TABLE #avetime...

  • RE: Determine Average Time between dates

    Maybe I'm missing something. Did you change the second query? If so, it didn't take. I've tried some different things with it but haven't had any luck...

  • RE: Determine Average Time between dates

    Thanks. This works great. Based on the sample data this does exacltly what I need it to do. Now, to broden the scope a little bit, how...

  • RE: Identify Range from look up table

    Thanks Mark. For some other applications I may use your solution. For this one I ended up with this, which returns just the records that are out of...

  • RE: Change single return record to multiple

    Thanks. Actually ended up using the following based on another suggestion. Both work though.

    SELECT loginname,

    record_date,

    CAST(TOA AS decimal(18,1)) AS [Opps in Approach],

    app_time AS [Approach Average Time],

    app_perc_adv...

Viewing 15 posts - 61 through 75 (of 144 total)