Jumat, 02 Januari 2015

Re: [MS_AccessPros] Previous Month Filter

 

Simplest solution:
if month(now())=1 then

Year([Test_Date]) = Year(Now()) -1 And Month([Test_Date]) =12)

else

Year([Test_Date]) = Year(Now()) And Month([Test_Date]) = Month(Now()-1)
endif

You could use Datediff function as well.

Rajiv

On 2 Jan 2015 23:40, "statmanbp@yahoo.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:
 

I have a filter that calls for the previous month

"

Year([Test_Date]) = Year(Now()) And Month([Test_Date]) = Month(Now()-1)

"

did not think about January of the next year.  Any help would be appreciated.



__._,_.___

Posted by: Rajiv <torajiv@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar