How to declare the syntax when my [SCHD_START] are in Date/Time Field. For
example, #01/01/2005 12:00:00 PM#. I just can't compare the values to get
the results I want. I got a separate field [DateEntered] which contain
solely the Date only. For example, #01/01/2005#. is it possible to use it to
fill up the time field in [SCHD_START]?
My Syntax:-
=Sum(IIf([SCHD_START]>=#12:00:00 PM# And ([SCHD_START]<#6:00:00 PM#),1,0))
You can get only the Time part of the date/time by using
TimeValue([SCHD_START]).

Signature
Duane Hookom
MS Access MVP
--
> How to declare the syntax when my [SCHD_START] are in Date/Time Field. For
> example, #01/01/2005 12:00:00 PM#. I just can't compare the values to get
[quoted text clipped - 5 lines]
> My Syntax:-
> =Sum(IIf([SCHD_START]>=#12:00:00 PM# And ([SCHD_START]<#6:00:00 PM#),1,0))
Seikyo - 17 Mar 2005 02:27 GMT
I do a timevalue to it but the response I get is saying the function too
complex in the reports.
=Sum(IIf(TimeValue([SCHD_START])>=#12:00:00 PM#,1,0))
> You can get only the Time part of the date/time by using
> TimeValue([SCHD_START]).
[quoted text clipped - 8 lines]
> > My Syntax:-
> > =Sum(IIf([SCHD_START]>=#12:00:00 PM# And ([SCHD_START]<#6:00:00 PM#),1,0))
Seikyo - 17 Mar 2005 03:41 GMT
I find another way to do it. I used DatePart instead to compare the hour.
Think this is much more easier to compare with. :-)
=Sum(IIf(DatePart("h",[SCHD_START])>=12 And
DatePart("h",[SCHD_START])<18,1,0))