Date checking syntax

C

ChrisG

Hello,

I am trying to check that a date is between a range and is also in a
particular month, this one being january. I know this syntax is wrong but i
cant begin to think how to look at only the month part of the date. The
current formula is shown below.

=(IIf(([Date1] Between [startdate] And [enddate]) and ([date1] in
jan)),[TotalFee]*[perc1],0))

All the best

Chris
 
M

Marshall Barton

ChrisG said:
I am trying to check that a date is between a range and is also in a
particular month, this one being january. I know this syntax is wrong but i
cant begin to think how to look at only the month part of the date. The
current formula is shown below.

=(IIf(([Date1] Between [startdate] And [enddate]) and ([date1] in
jan)),[TotalFee]*[perc1],0))


Just use the Month function (unless the year makes a
difference).

=IIf(([Date1] Between [startdate] And [enddate]) and
(Month([date1]) = 1) ,[TotalFee]*[perc1], 0)
 
Top