DateAdd Function Return Range of Records?

  • Follow


I have a weekly report that pulls out total number of orders from the 
previous week using the DateAdd function:

=Sum(IIf(((([Date_Requested]) Between DateAdd("d",-7,Date()) And 
Date())),1,0))

I would like to add to my report a list of the total orders that were 
ordered two weeks ago through one week ago.  I think it should look something 
like this:

=Sum(IIf(((([Date_Requested]) Between DateAdd("d",-14,Date()) And 
DateAdd("d",-7))),1,0))

but unfortunately I am getting a message telling me I entered a function 
containing the wrong number of arguments.

Any suggestions?
0
Reply Utf 2/16/2010 7:04:01 PM

I think I figured it out as this appears to give me what I want:

=Sum(IIf(((([Date_Requested]) Between DateAdd("d",-14,Date()) And 
DateAdd("d",-7,Date()))),1,0))


"Matt" wrote:

> I have a weekly report that pulls out total number of orders from the 
> previous week using the DateAdd function:
> 
> =Sum(IIf(((([Date_Requested]) Between DateAdd("d",-7,Date()) And 
> Date())),1,0))
> 
> I would like to add to my report a list of the total orders that were 
> ordered two weeks ago through one week ago.  I think it should look something 
> like this:
> 
> =Sum(IIf(((([Date_Requested]) Between DateAdd("d",-14,Date()) And 
> DateAdd("d",-7))),1,0))
> 
> but unfortunately I am getting a message telling me I entered a function 
> containing the wrong number of arguments.
> 
> Any suggestions?
0
Reply Utf 2/16/2010 7:31:03 PM

1 Replies
380 Views

(page loaded in 0.673 seconds)


Reply: