# Pulling Last Months Date for Reporting

#### GMFTM

##### New Member
This is what I am doing currently; HAVING (((Month([TimeStamp]))=12)

Now I know there is a way to write this so you don't have to touch it each month. Help?

### Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

#### Joe4

You can get the number of the previous month like this:
Code:
``Month(DateAdd("m",-1,Date()))``
So, it should look something like:
Code:
``[COLOR=#333333]HAVING (((Month([TimeStamp]))=[/COLOR]Month(DateAdd("m",-1,Date()))[COLOR=#333333])[/COLOR]``

#### GMFTM

##### New Member
That was it, I had the Month(DateAdd("m",Date(),-1)), that I was trying and had it backwards.....hello 2017, lol.

You can get the number of the previous month like this:
Code:
``Month(DateAdd("m",-1,Date()))``
So, it should look something like:
Code:
``[COLOR=#333333]HAVING (((Month([TimeStamp]))=[/COLOR]Month(DateAdd("m",-1,Date()))[COLOR=#333333])[/COLOR]``

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,426
Messages
5,837,162
Members
430,480
Latest member
iangessey

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back