Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

How to format datetime field if time portion falls outside threshhold.

I have a varchar field that has been successfully converted to a datetime field that has values like this:
4/12/2005 9:25:16PM

I need to have this value turn red if the timestamp falls outside of 9:00:00PM to 1:00:00AM regardless of the date.
0
brooksmato
Asked:
brooksmato
1 Solution
 
vidruCommented:
Right click the field > Format Field > Font tab > click the [x+2] button next to 'Color' > and enter a formula like:

If CTime({Table.Field}) < Time(21,00,00) and CTime({Table.Field}) > Time(1,00,00) Then
  crRed
Else
  crBlack

If you've already got a formula converting the field to Date/Time, you could use CurrentFieldValue:
If Time(CurrentFieldValue) < Time(21,00,00) and Time(CurrentFieldValue) > Time(1,00,00) Then
  crRed
else
  crBlack

-dave
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now