Results 1 to 12 of 12
  1. #1
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12

    How to find data in a specific date

    I need to put a criteria in a date field that will search for a specific date. We use is format. 11/20/2024 11:40:41 AM.



    Thanks

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,821
    Hi
    Where are you wanting to search from?

    If it is a Form then in the header rof the Form create a Combobox that will look for the specific Date.

    If you are using a query then in the design of the query, click in the Criteria Row of the Date Column and enter
    the following :-
    [Enter Date Required]

  3. #3
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12
    I don't see the option to PM you?

  4. #4
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,821
    Click on my name and then select Private Message

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    I would not use an input box for criteria for a query
    Open to so many errors.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12
    not an option.

  7. #7
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12
    I tried you suggestion and on the query I working with it didn't work. However, on another query it did. Can I email you the query?

  8. #8
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,821
    Upload the database to the forum

  9. #9
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12
    It is huge. Here is the query. The field is ComplanitTime.
    SELECT DISTINCT Complaints.ComplaintNo, Complaints.City AS Cityname, Complaints.DispatchTime, Complaints.ComplaintTime, Complaints.ComplaintCode, Complaints.Status, Complaints.ETA, Nz([CONtblPeople].[LastName],"N/A") & (", "+[CONtblPeople].[FirstName]) AS Ofc, Complaints.AddressNo, Complaints.Street, Complaints.Unit, Complaints.PriorityCode
    FROM Complaints LEFT JOIN CONtblPeople ON Complaints.RespondingOfficer = CONtblPeople.ContactID
    WHERE (((Complaints.ComplaintTime)=[Enter date]) AND ((Complaints.Status)="Open" Or (Complaints.Status)="Dispatched" Or (Complaints.Status)="Arrived"))
    ORDER BY Complaints.City, Complaints.ComplaintTime;

  10. #10
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    How do you determine the time to the exact second?
    I would go for a minute and add a minute and select everything in between.
    If you just actually want the date, use DateValue()
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  11. #11
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12
    I used this and it worked.


    >=[Forms]![frmSwitchboard]![txtStartDate] And <DateAdd("d",1,[Forms]![frmSwitchboard]![txtEndDate])

  12. #12
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    So that gets you everything after that date an time and up to the next day with same time?
    So now you can have a record on one date and another possibly on the next day?
    Is that what you wanted?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 5
    Last Post: 06-06-2024, 10:33 AM
  2. Replies: 7
    Last Post: 03-14-2022, 06:30 PM
  3. Replies: 3
    Last Post: 08-21-2012, 03:05 PM
  4. Replies: 5
    Last Post: 03-03-2011, 03:56 PM
  5. find specific data
    By hoachen in forum Queries
    Replies: 3
    Last Post: 08-19-2009, 08:54 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