previous month

travismp

Registered User.
Local time
Today, 12:22
Joined
Oct 15, 2001
Messages
386
I searched but could not find a simple answer.

I want to see all results from last month for [TestDate]

Month(Date())-1) ? ? ? ? ? ? ?
 
I found this on a microsft page

Year([TestDate])*12+DatePart("m",[TestDate])=Year(Date())*12+DatePart("m",Date())-1

that is a beast. Does anyone have something better? If not this will work. I just thought I saw something much more simple a couple years back. Thanks.
 
Alternatively, you can use this criteria for the [TestDate] field:-

Between DateSerial(Year(Date()), Month(Date()) - 1, 1) And DateSerial(Year(Date()), Month(Date()), 0)


That is, between the first day and the last day of the previous month.
.
 
Hi -

Try this as the criteria for your date field:
Code:
Between DateSerial(Year(Date()),Month(Date())-1,1) And DateSerial(Year(Date()),Month(Date()),0)

HTH - Bob
 

Users who are viewing this thread

Back
Top Bottom