A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conditional Formatting with a Date Function



 
 
Thread Tools Display Modes
  #1  
Old January 9th, 2010, 02:41 PM posted to microsoft.public.access.reports
rm
external usenet poster
 
Posts: 12
Default Conditional Formatting with a Date Function

Two fields on a report [timing] and [started] If started timing + 10
minutes then the text should be red.

In the Conditional Formatting form the following has been entered for
Condition 1.

Expression 1 is [started]DateAdd("n",10,[timing])

This does not work.

Also tried Field Value is Greater than [timing] + 10

Also tried Expression 1 is DateDiff("n", [timing], [started]) 10.

No luck.

The help file is of no value. For example, nowhere in the text is
there any indication that "[" and "]" must surround a field name.
  #2  
Old January 9th, 2010, 06:55 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Conditional Formatting with a Date Function

On Sat, 9 Jan 2010 06:41:10 -0800 (PST), rm wrote:

Two fields on a report [timing] and [started] If started timing + 10
minutes then the text should be red.

In the Conditional Formatting form the following has been entered for
Condition 1.

Expression 1 is [started]DateAdd("n",10,[timing])

This does not work.

Also tried Field Value is Greater than [timing] + 10

Also tried Expression 1 is DateDiff("n", [timing], [started]) 10.

No luck.

The help file is of no value. For example, nowhere in the text is
there any indication that "[" and "]" must surround a field name.


A Date datatype field value in Access must be a complete date and time
value.
I would guess that [timing] is NOT actually a date/time value (i.e.
1/5/2010 3:15:00 PM) but rather a *length* of time value (i.e. 3
hours 15 minutes) even though you may have set the field's datatype to
Date/Time which is not a date. Therefore 3 hours and 15 minutes + 10
minutes = 3 hours and 25 minutes, which is never going to be
1/5/2010 3:15:00 PM.

Assuming my guess is correct, here is a comparison of actual values
from the debug window after the 10 minutes has been added to the 3:15
PM [timing] time:

[Started]
?cdbl(#1/5/2010 03:15:00 PM#)
40183.6354166667
[Timing] if stored in a Date/Time field:
?cdbl(#3:25 PM#)
0.642361111111111

You'll notice the [Started] value, which included the date value of
(40183.) is much greater than the [timing] value.

Copy and paste into a reply your exact conditional formatting
expression, as well as an example of the data actually stored in
[Timing] and in [Started] and their datatypes and we'll see what we
can do for you.

Note: It's always a good idea to surround field names with brackets.


--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.