Results 1 to 12 of 12
  1. #1
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155

    Query Time

    I think I may have screwed up.

    I am trying to run a query to show data between two dates. I know how to create a perimeter BUT my data is in MM/DD/YYYY HH:MM:SS AM/PM.



    How can I query a full day?!

  2. #2
    mkallover is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    25
    Depending on the query that shouldn't matter. You're just trying to display records where the date falls between two dates right?

    Can you paste the query?

  3. #3
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    If I understand what you are after, you could strip the time portion off by using the datevalue() function.

  4. #4
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I am trying to automate reporting. Exporting to excel is now causing issues with Filter due to the size exceeding 10,000. All I want is to fitler the data and use totals to give me a count for a certain date or week or what ever the user wants to query for. In the actual table we still want to keep the time stamp. But in the Query it does not matter.

    I can not paste the actual query/table but I will create a sample.

    My end result is to have a form with several subform/queries in it that gives the user the counts they need for the date ran. <-- That part I think I have covered thanks to the help I got for the Time Sheet

  5. #5
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I also want it to group by date and not by time. Who cares how many of that type were done by that particular time stamp. I just need it for the day.

    Even when I tried running a parameter for 4/14/2011 00:01:00 AM to 4/14/2011 11:59:00 PM it wouldn't bring anything up...

  6. #6
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    How about this


    SELECT datevalue(tblData.daterecieved), tblData.doctype, Count(tblData.doctype) AS CountOfdoctype
    FROM tblData
    GROUP BY datevalue( tblData.daterecieved), tblData.doctype;

  7. #7
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I got a Data Type mismatch in criteria expression error...

  8. #8
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Could you please provide the query that gave the error?

  9. #9
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I think it has something to do with the table being a click event. When they click the text box on the form, it produces the NOW function and writes it to the table. All I did was change the tbl title to match my copy....

    Do you think that could cause a issue? Let me mold the sample to match my hard copy. Give me a few minutes.

  10. #10
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Ugh, It works in the sample. I cant send you my actual database. But thanks for the information! I will keep trying.

  11. #11
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    The table and field names must match your working database, so you will have to make those adjustments before the query will work.

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Also make sure there are no Null values in that date field. I suspect they would cause an error. That may be why it works in the sample but not the actual db.
    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. Replies: 12
    Last Post: 02-22-2011, 03:39 PM
  2. Append Query: Time Stamp
    By AKQTS in forum Programming
    Replies: 3
    Last Post: 08-16-2010, 12:34 PM
  3. Query Date without comparing time
    By Bosco in forum Queries
    Replies: 5
    Last Post: 06-28-2010, 03:59 PM
  4. ODBC and Long Query Time
    By pdouglas in forum Access
    Replies: 0
    Last Post: 07-09-2009, 10:21 AM
  5. Time Query
    By kbsudhir in forum Queries
    Replies: 1
    Last Post: 07-06-2009, 05:19 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