Criteria Between

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

Guest

Hi,

im trying to set a criteria on a date/time field, but im not sure how i
would set this.

this is what i have got at the moment

Between ([Forms]![main]![ctdate] & " " & #04:00:00#) And
(([Forms]![main]![ctdate]+1) & " " & #03:59:00#)

the ctdate field is specified by the user and only contains the date, the
reason why im trying to do it like this is because i need to return results
as if the day ran from 4:00am - 3am the following day, its not returning any
results though but its not giving any erros?
 
Thanks, works a charm

jon
Allen Browne said:
Try:
= DateAdd("h", 4, [Forms]![main]![ctdate]) AND
< DateAdd("h", 28, [Forms]![main]![ctdate])

Also, make sure the cursor has left the ctdate text box on your form. The
Value may not be up to date yet if it still has the focus.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

jon said:
Hi,

im trying to set a criteria on a date/time field, but im not sure how i
would set this.

this is what i have got at the moment

Between ([Forms]![main]![ctdate] & " " & #04:00:00#) And
(([Forms]![main]![ctdate]+1) & " " & #03:59:00#)

the ctdate field is specified by the user and only contains the date, the
reason why im trying to do it like this is because i need to return
results
as if the day ran from 4:00am - 3am the following day, its not returning
any
results though but its not giving any erros?
 
Back
Top