Date Fields

C

CaptPhil

In my database, I have a date and time field. Using conditional formatting, I
would like to highlight this date on a form when the entered date = today.
The condition "must equal Date()" works if my date field only contains a
date. If my field contains a date and time, the solution does not work. I
think it has to do with the Date function equaling the date at 00:00 so it is
not a perfect match? I need the function to ignore the time in my field.
 
L

Linq Adams via AccessMonster.com

Where YourDateTimeField is the name of your control holding the date/time
data.

Date = Left([YourDateTimeField],Instr([YourDateTimeField]," ")-1)
 
F

fredg

In my database, I have a date and time field. Using conditional formatting, I
would like to highlight this date on a form when the entered date = today.
The condition "must equal Date()" works if my date field only contains a
date. If my field contains a date and time, the solution does not work. I
think it has to do with the Date function equaling the date at 00:00 so it is
not a perfect match? I need the function to ignore the time in my field.

Using Conditional Formatting, set Condition1 to
Expression Is.
Set the Expresion to:
DateValue([DateField] = Date()
 
L

Linq Adams via AccessMonster.com

I knew there was a native Access function that would pull the date part from
a date/time field, Fred, but I couldn't for the life of me remember what it
was called!

;0)>
 
C

CaptPhil

fredg said:
In my database, I have a date and time field. Using conditional formatting, I
would like to highlight this date on a form when the entered date = today.
The condition "must equal Date()" works if my date field only contains a
date. If my field contains a date and time, the solution does not work. I
think it has to do with the Date function equaling the date at 00:00 so it is
not a perfect match? I need the function to ignore the time in my field.

Using Conditional Formatting, set Condition1 to
Expression Is.
Set the Expresion to:
DateValue([DateField] = Date()

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Thanks, Simplicity, just what I wanted.
 
Top