Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401

    Unanswered: Perf Report Query

    Code:
    CREATE TABLE [Perf] 
    (
    [TransId] INTEGER
    ,[FileNo] VARCHAR(80)
    ,[TimeInSeconds] INTEGER
    ,[FileSizeMB] INTEGER
    ,[FileName] VARCHAR(255)
    ,[StartDate] datetime
    )
    
    Ok!! Here's the Problem. I am working on a perf stats report. FileType is First 9 chars of the field FileName. I need to compare a similar filename from this month to last month or before ordered by file size.

    Maybe this is a very simple query but currrently my mind refuses to work. Seeking F1.
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Guess what ... my brain started functioning again ...

    1.Though I gave you the DDL ...

    2. the data is not availible to me ... though a few records could be cooked up .. will try to do that when I come back tomorrow morning.

    3. If I had tried anything great ... I would not have pressed the F1 button
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    It's probably going to be one of these ugly joins. I am assuming you want the TimeInSeconds, and Size fields for comparisons? I had to do something similar for doing DB size trend analyses. My solution was to put a runnumber on the table, in order to guarantee that I was able to compare certain points to each other. This works great, if you have absolute control over the process, which you might not have. How about

    Code:
    select buncha.fields
    from perf b join perf a on convert(varchar(10), a.StartDate) = convert(varchar(10), dateadd (dd, -30, b.StartDate)) 
    where a.transID = something
    That should get you the day of TransID, and 30 days before that, and 30 days before that, and.... Let me know if it does not work out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •