Calculated date field in form to table

S

sendahook

John said:
-
I needed to just pull the records that are active, so I
needed to return all records that are between the [STARTINGDATE] and
the date that was entered to be x many days in the future ie... if the
starting date is 03/30/05 and 3 days was selected under the
[TIMEACTIVE] field, I need to query to find all records between
03/30/05 and 04/02/05. So, under the [STARTINGDATE] criteria I have:
Date()
Under the [TIMEACTIVE] criteria I tried something like this:-
DateAdd("d",[TIMEACTIVE],[STARTINGDATE]) I thought this would do the-
calculation and give me a my desired results but no luck. Any
suggestions on how to enter the criteria correctly under the
[TIMEACTIVE] field?-

Since DateAdd() returns a Date/Time value, and TimeActive is a number
field not a date, it's not surprising that you get the wrong value!

Try a criterion on [Startingdate] of
-
= Date() AND = DateAdd("d", [TIMEACTIVE], Date())-

if I'm understanding you correctly.

John W. Vinson[MVP]

Thanks John, you've been a tremendous help!! Actually, last night
before I checked this post I was playing around with this. Through
sheer dumb luck, I think I figured it out. I placed the following in
the criteria of the [TIMEACTIVE] field in a query:
DateAdd("d",[TIMEACTIVE],[STARTINGDATE])>Date() This along with
<Date() in the [STARTINGDATE] criteria gave me all the records that
fell between the two dates...and believe it or not I got my desired
results!!! Thanks again for your assistance!!
 
Top