Results 1 to 2 of 2
  1. #1
    Desstro's Avatar
    Desstro is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2010
    Posts
    185

    Random Records With Field Parameters For Calculating Time To Be No Less Than / No More Than

    Alright, this is probably easy for some of you guru's out there but I am struggling with how to best pose this question. Here is my best shot...



    I have a table with the following fields:
    (Field Name - Data Type)

    Song List - Short text
    Song Length - Short Time
    Date Previously Chosen - Date/Time
    Date Available For Re-Use - Calculated (=Date Previously Chosen+90 Days)
    Available - Yes/No - (This field is calculated to be a yes value if Date Available For Re-Use is >System Date.

    I would like to create a form with a button on it that will run a query and fill in query results in the forms text boxes. I think I can handle that...

    Next to the text boxes on the form I want buttons that on click will fill in system date for that record in the field Date Previously Chosen.

    Where I am stuck is how do I set up the query...

    I would like to have the query return random results that are:
    1. Yes value for Available
    2. The total calculated length of time for all random results cannot be less than 50 minutes or more than 70 minutes

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Create a query to select records that are "available" and other attributes.
    Then add an extra field and populate it with a random number.
    Select a group from these records sorted by the random number.
    You could put these in a record set and calculate where the sum of duration is between 50 and 70,
    then keep the list of titles(records) in the group.


    Here is a link to a similar (selecting random records) post.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 11-19-2016, 07:45 PM
  2. Replies: 1
    Last Post: 04-01-2015, 01:29 AM
  3. Replies: 1
    Last Post: 04-29-2014, 12:20 AM
  4. Replies: 1
    Last Post: 04-07-2014, 07:04 AM
  5. Replies: 12
    Last Post: 02-22-2011, 03:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums