Results 1 to 5 of 5

Thread: SQL question

  1. #1
    Join Date
    Sep 2003
    Location
    ATL, GA
    Posts
    4

    Unanswered: SQL question

    I am not sure this is the place to ask a how-to question but here goes....
    I am querying at database at work which is part of my first taste of offices after school..... I am searching through billing amounts and hours according to the criteria of date..... clients have been billed on separate dates, but I want to sum the hours and costs to clients of each date and display those sums as one record. I can only so far display each date with the costs to the client associated to them. so instead of listing the same client on multiple dates I want to list them once for those dates with the amounts associated summed together. Any hints on how to do this concerning code? Sorry I know this is probably not good enough at all to answer lol! any answers please email me

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Exclamation

    When posting a question, it is good practice to supply information about the operating system, database version, descriptions of the tables, sample of the source data and example of the expected results.

    I assume you are asking how to 'pivot' a table, therefore for an Oracle database, you better Ask Tom:

    http://asktom.oracle.com/pls/ask/f?p...3616928827525,
    http://asktom.oracle.com/pls/ask/f?p...:766825833740,
    http://asktom.oracle.com/pls/ask/f?p...:124812348063,
    http://asktom.oracle.com/pls/ask/f?p...:988230525691,
    http://asktom.oracle.com/pls/ask/f?p...:419593546543,


    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Sep 2003
    Location
    ATL, GA
    Posts
    4

    Access DB

    My apologies, it is an Access DB and I am working with one table to do this. It lists clientid, date, hours, amount and other data I am not using for this. But since there is a range of dates I am using as criteria for the queries, of course it produces a record for each date that time was billed for each client. So as I said, client 123 is listed multiple times because there was time billed on multiple dates within the range criteria associated with date. I want to take all the listings, sum the hours and amounts, and just list it once in the results. I want the date and its critieria to be nothing more than a range to search instead of a record listing.

  4. #4
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Exclamation

    Not necesary to apologize, we all learn a little every day.

    For a solution to your problem, look under 'Pivot Table' in the MS Access help.

    I know how to do it in Excel, but never done it in Access.

    Good luck,

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  5. #5
    Join Date
    Sep 2003
    Location
    ATL, GA
    Posts
    4

    thanks!

    Thanks, man! I will check that out definitely. But can you tell me how you did it in Excel? If it is a function I mean. I bet it is similar to that in SQL. Or at least the logic is pretty close. Thanks again man! I'll leave ya be past this, sorry heheheh!

Posting Permissions

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