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
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
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]
You can PM me for help. Good Read https://docs.microsoft.com/en-gb/off...on-description
To attach file: https://www.accessforums.net/showthread.php?t=70301
I don't see the option to PM you?
Click on my name and then select Private Message
You can PM me for help. Good Read https://docs.microsoft.com/en-gb/off...on-description
To attach file: https://www.accessforums.net/showthread.php?t=70301
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
not an option.![]()
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?
Upload the database to the forum
You can PM me for help. Good Read https://docs.microsoft.com/en-gb/off...on-description
To attach file: https://www.accessforums.net/showthread.php?t=70301
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;
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
I used this and it worked.
>=[Forms]![frmSwitchboard]![txtStartDate] And <DateAdd("d",1,[Forms]![frmSwitchboard]![txtEndDate])
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