report from query not load values

ryprobg

Member
Local time
Today, 23:52
Joined
Sep 3, 2022
Messages
59
i have a query and i put date() as creteria in deb coloumn to get filtred values of date/time of today
but in my report issu of this query it still empty.
deb format in my form is : "dd-"mm"-yy "hh:nn
please help me to resolve problem
 

Attachments

  • 0440.PNG
    0440.PNG
    13 KB · Views: 132
  • processed-a03beaab-986d-4449-99d4-cb645e03c03c_mFJzb79w.jpeg
    processed-a03beaab-986d-4449-99d4-cb645e03c03c_mFJzb79w.jpeg
    3.8 MB · Views: 123
If your date field has a time element in it, then you cannot compare to Date as that has no time element.
So use the datevalue() function on your date field and compare that to date().
Google how to use the function.
 
the problem is not that you tell me
if i make Année(Date()) or Mois(Date()) as createria in my other queries my report load date values normaly..the problem is just in date() mean today and date()-1 mean yesteday.
 

Attachments

  • hn.PNG
    hn.PNG
    53.9 KB · Views: 111
What are you actually showing? :(
One cannot see the names of the fields. :( You really do not make it easy for people to help you, do you? :(
You can only compare like for like.

Try using a date range. That will then largely overcome the time element issue.

Show some sample values of deb.
 
@Gasman has told you the problem, but you haven't grasped the reasoning behind the principle.

All dates in Access are actually a date and time expressed as a decimal number and formatted so that we understand what they represent.
Your date values have a time portion :
08/09/2022 12:49:53

Your Criteria by using Date() is actually :
08/09/2022 00:00:00

Which Access truncates and displays as 08/09/2022
So your query is actually saying

Code:
SELECT * FROM yourTable
WHERE YourDate field = 08/09/2022 00:00:00
And none of your dates actually match that value.

If you remove the time portion from your data it will work :
Code:
SELECT * FROM yourTable
WHERE DateValue([YourDateField]) = 08/09/2022
 
@Gasman has told you the problem, but you haven't grasped the reasoning behind the principle.

All dates in Access are actually a date and time expressed as a decimal number and formatted so that we understand what they represent.
Your date values have a time portion :
08/09/2022 12:49:53

Your Criteria by using Date() is actually :
08/09/2022 00:00:00

Which Access truncates and displays as 08/09/2022
So your query is actually saying

Code:
SELECT * FROM yourTable
WHERE YourDate field = 08/09/2022 00:00:00
And none of your dates actually match that value.

If you remove the time portion from your data it will work :
Code:
SELECT * FROM yourTable
WHERE DateValue([YourDateField]) = 08/09/2022
but i need the time portion permenantly this is a time stop sheeft and i need it to calculate later working hours
 
We aren't removing it from your data, just in the comparison for the criteria for the report.
It's just a select query, not an update query.
 
We aren't removing it from your data, just in the comparison for the criteria for the report.
It's just a select query, not an update query.
ok let me see how we can do that : my db is below
login : admin
pass : 1234
thank you
 

Attachments

No, it is for you to do. :(
What is with the royal we? :(

You need to do some of the work for yourself, not just chuck a DB up and say 'fix it for me' :(
 
No, it is for you to do. :(
What is with the royal we? :(

You need to do some of the work for yourself, not just chuck a DB up and say 'fix it for me' :(
it not work for me since yesterday im tired
 
it not work for me since yesterday im tired
You're tired? Sometimes the solution is to just take a break. Do something else for a while. Get some fresh air. Even take a nap. Come back to the problem refreshed and ready to take a different approach, or try something else.

If, on the other hand, there is a specific concept you do not understand, sometimes the tried and true method is "Try It and See What Happens". That's how many of us attack our problems. It's a good feeling when you finally get it.
 
it not work for me since yesterday im tired
Best try another hobby then? :)
You have been advised what you need to do. Use DateValue() on the date field that you want to compare against Date()-1 and no need to include it in the query output.

It is only going to get harder from now on, so you may as well make the effort now, or take up something else?
 
Best try another hobby then? :)
You have been advised what you need to do. Use DateValue() on the date field that you want to compare against Date()-1 and no need to include it in the query output.

It is only going to get harder from now on, so you may as well make the effort now, or take up something else?
thank you there is no way to get values.. [Closed]!
 

Users who are viewing this thread

Back
Top Bottom