Results 1 to 7 of 7
  1. #1
    cooper is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    24

    Show report for today only

    Hi,



    I have a report which has a multiple text boxes. These text boxes show the sum of different values that were entered in table.

    Users log in everyday and fill in the information in the form, which saves the date in the table and then I used a query to form a report.

    but I want to display only "Current date" information - how do I do that? Also, I don't want them to ENTER the date themselves. I used date() function in my form to pull out todays date as well.

    I tried to put "<=Current_Date" as the criteria for dte in the query but that gives an error saying "Data mismatch"

    any ideas?

    thanks!

  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,640
    Try just putting this in the criteria:

    Date()

    Note that sometimes Access will drop the parentheses, which I wouldn't worry about.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cooper is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    24
    brilliance! worked. thank you so much!

    one thing though - sometimes the user might want to see reports for other days as well. I guess I could use Between[startdate] And [end date] right? but how do I incorporate both options as "today" or for other days?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Personally I almost always use a form to have the user input the criteria. In this case, you could do that and default both textboxes to today's date.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    KrisDdb is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    58
    Hey Cooper

    I have used something like this very recently. so i thght this might help you out. Design a form with a couple of text boxes.. for Start date and End date. Then put the following code in the control sources for each of them:

    =[Forms]![yourFormName].[txtStartDate]
    =[Forms]![yourFormName].[txtEndDate]

    When user wants to see reports for other days as well, this will let you give the start date and end date. Make sure you give the same code for the date range in the query criteria that fetches your data. And like Paul already said, you could default them to Date(), so when you dont specify a date range, it returns "today" like you want it to.

    HTH

  6. #6
    cooper is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    24
    wow sorry for the late reply!! thanks alot buddy!! really appreciate it

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Happy to help, if it was me that helped.
    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. Entering Today's Date
    By Alex Motilal in forum Access
    Replies: 5
    Last Post: 08-23-2011, 12:22 AM
  2. If problem-comparing field+1735<Today()
    By Madmax in forum Access
    Replies: 6
    Last Post: 06-23-2011, 01:38 PM
  3. Query to display ONLY entries from today
    By Juan4412 in forum Queries
    Replies: 9
    Last Post: 01-15-2011, 05:34 PM
  4. Replies: 2
    Last Post: 01-12-2011, 12:00 AM
  5. Set Calendar to default to today's date
    By RickM in forum Access
    Replies: 1
    Last Post: 02-22-2009, 04:51 AM

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