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

Posted on 2005-04-13
Last Modified: 2010-07-27
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.
Question by:brooksmato
    1 Comment
    LVL 13

    Accepted Solution

    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

    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


    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now