Results 1 to 2 of 2

Thread: creating random future dates with datediff()

  1. #1

    creating random future dates with datediff()

    Just need to set up a field with a series of random future dates based on an exisiting date - assume this is for an inventory (it isn't but the example is adequate)

    Date_Entered Date_Sold

    and you want to practice reports like 'what is the average days item_X is on the shelves.

    So you generate 1,000 date_entered with a single date, and want to replace Date_Sold with a increment of between 1 and 45 days (Access Table)

    I tried

    Update mytable SET Date_Sold = Date_Entered + Int((45-1+1) * Rnd +1)

    The issue seems to be that the same random number is used to update all rows.

    Has anyone else experience this and know of a workaround?

  2. #2

Posting Permissions

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