i want to show all record saved today (the date field = Date())
how to only show the records that entered today???
Collapse
X
-
Tags: None
-
Mostafa,
in the simplest situation, in Query editor you only need to set the criteria equal toNow()
However, you will find that because of the way access stores dates there's a hidden time included with the date (00h00)
So often one may have to use something like:
>= [Now()] < [Now()] + 1
And there's a twist on the date is stored so that if the date is stored: mm/dd/yyyy hh:mm:ss and you only enter m/d/yy then search may fail.
Please refer to:
Dealing with international dates: http://allenbrowne.com/ser-36.html
Please check you PM in a little bit, I'll forward you my boilerplate of general links and tutorials that should help you get things going.Last edited by zmbd; Apr 27 '16, 08:16 PM. -
no all i need to get all the records entered in the whole day ,, not in the time .. did u understand ?Comment
-
Hi Z.
Actually, it's really not necessary to complicate matters when dealing with the current date.Date()
returns exactly that - with no time element included.
When dealing with dates, as opposed to times or timestamps (A set date and time.), it's never a good idea to useNow()
. I've seen it recommended many times, but that doesn't make it right.
BTW. There are functions (DateValue() & TimeValue()) which will separate out the date and time elements from any timestamp value.Comment
-
NewPa: learn something new and you are all too right in that what is often suggested isn't always the best, nor correct, way to do things.
TBH - I've typically used theNOW()
as most of my work in the lab requires the time component for auditing reasons; thus, this function tends to be my default for dates. :)Comment
Comment