Results 1 to 2 of 2
  1. #1
    bandmolson is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    1

    Days since last sale

    I have a table of sales personnel that tracks all sales and includes the salesman, item sold and date of sale. I want to display in a query each salesperson and how many days since the last sale was made. I have a number of days since last sale but only want to include the number of days since the most RECENT.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Try this pseudo SQL, using your names:

    SELECT SalesPerson, Max(SaleDate) AS LastSale, DateDiff("d", Max(SaleDate), Date()) AS DaysSinceLastSale
    FROM TableName
    GROUP BY SalesPerson
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Criteria for a monthly sale
    By xtrareal22 in forum Queries
    Replies: 2
    Last Post: 12-18-2013, 10:14 AM
  2. Sale Silver Jewelry
    By azhar2006 in forum Database Design
    Replies: 2
    Last Post: 12-01-2013, 09:00 AM
  3. Group results to show last sale
    By tweety in forum Queries
    Replies: 21
    Last Post: 04-30-2013, 08:48 AM
  4. The easiest way to make a point of sale
    By eskybel in forum Queries
    Replies: 79
    Last Post: 11-20-2012, 07:30 AM
  5. Stock Control/ Customer/ Sale database
    By Halwa in forum Access
    Replies: 1
    Last Post: 06-06-2012, 02:49 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