Results 1 to 4 of 4
  1. #1
    LoveLearning is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2012
    Posts
    4

    show sum of results only for last 7 days on a form

    Hi,

    I am trying to sum a field (Minutes) only if the date field (ServiceDate) is 7 days prior to todays date. Any suggestions to help would be appreciated? I have played around with the IF statement, yet not having much luck.

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Just check if below gives some guidelines :

    Code:
    SELECT 
    	Sum(myTable.TheMinutes) AS SumOfTheMinutes
    FROM 
    	myTable
    WHERE 
    	(
    		(
    			(myTable.ServiceDate) Between Date() And Date()-7
    		)
    	);
    Thanks

  3. #3
    LoveLearning is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2012
    Posts
    4
    That worked....Thanks so much!

  4. #4
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Glad you found it helpful.

    Thanks

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

Similar Threads

  1. Replies: 6
    Last Post: 05-14-2012, 07:24 AM
  2. Only Show Last 7 Days of data
    By MFS in forum Queries
    Replies: 8
    Last Post: 04-05-2012, 01:25 PM
  3. Replies: 4
    Last Post: 07-28-2011, 06:57 AM
  4. Query Show Results on Form
    By john226 in forum Queries
    Replies: 3
    Last Post: 05-09-2011, 11:38 AM
  5. Open a text file to show results...
    By kkrishna in forum Programming
    Replies: 3
    Last Post: 08-13-2010, 09:38 AM

Tags for this Thread

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