Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004

    Unanswered: Trying to get info from these results, what should my query look like?

    In the attached photo, you will see the query in the background, and the results in the foreground.
    What I would like to do is get a count of each of the matching prodkeys so I can see how many have been used and compare them to my total number of software licenses
    I'm searching on the pc software table using the software title to get the current list. I have a havelicenses table that stores the software titles and how many licenses for each. Some titles have a license key good for 5 users and another license key (for the same title) for 10 users. So the idea is to account for software, and when adding new software to see if there is a license key for it, if the key is at it's limit and be notified wether we can or can not use it in another pc.
    I have a total of 15 licenses for a piece of software.
    I have 2 licenses for this software
    License key 1 is good for 5 users.
    License key 2 is good for 10 users.
    If I have 3 pc's using key1 and 7 pc's using key 2
    I want to show the user that there are 2 more left for license key 1
    and 3 left for license key 2
    The user will be able to choose one of the keys to use for the software install.

    Am I being too confusing?
    I could use some help please.
    Attached Thumbnails Attached Thumbnails queryhelp.JPG   screen.JPG  

  2. #2
    Join Date
    Apr 2006
    Denver, Co. USA
    The query to get a count of each prodkey that matches your app name would look like this -
    SELECT prodkey, count(*) FROM installed_sw WHERE app = 'colname' GROUP BY prodkey
    It basically takes your query and groups the rows by the prodkey and counts how many rows are in each group.

  3. #3
    Join Date
    Mar 2004
    So grateful, thank you!

Posting Permissions

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