Counting Values In Reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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))
 
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))

Duane Hookom said:
You can get only the Time part of the date/time by using
TimeValue([SCHD_START]).

--
Duane Hookom
MS Access MVP
--

Seikyo said:
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))
 
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))
 
Back
Top