Extract current month

G

Guest

Hi,
I'm using the below expression to extract the month and year from the
field [entrance date],how can i do the following:

* put the query criteria current month.
* Put the query criteria the past month.

The expression is:
format(datepart([Entrance Date]),"yyyy/mm")
 
A

Allen Browne

In the Field row, type this in a fresh column:
TheYear:Year([Entrance Date])

In the next column, type:
TheMonth: Month([Entrance Date])

If you want the previous month, use this instead of [Entrance Date]):
DateAdd("m", -1, [Entrance Date])

You can add criteria under these calculated fields if desired.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top