# Last Day of Previous Month

**URL:** https://www.finalbuilder.com/forums/t/last-day-of-previous-month/4472
**Category:** Discussion
**Created:** [April 4, 2011, 6:30am UTC](https://www.finalbuilder.com/forums/t/last-day-of-previous-month/4472 "2011-04-04T06:30:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [April 4, 2011, 6:30am UTC](https://www.finalbuilder.com/forums/t/last-day-of-previous-month/4472/1 "2011-04-04T06:30:15Z")

</div>

Whats the best way to get the last day of previous month into an Automise variable?

For example: if today is 04/04/2011, I want the Automise variable to contain value 03/31/2011.  
if today is 07/28/2011, the Automise variable should be set to 06/30/2011.

I see that the date function only supports +/- minutes/hours/day/month/year... do I&nbsp;need to use vbscript somehow?

Thanks

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [April 5, 2011, 8:31am UTC](https://www.finalbuilder.com/forums/t/last-day-of-previous-month/4472/2 "2011-04-05T08:31:06Z")

</div>

Hi

You can do this with a very simple VBScript. I have attached an example project that demonstrates this.

Regards,

Steve

[DateExample.atz3](https://www.finalbuilder.com/forums/uploads/default/original/2X/c/caee523871dfdb2466e439305153c50516f8c7be.atz3) (1.996 KB)

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [April 5, 2011, 8:16am UTC](https://www.finalbuilder.com/forums/t/last-day-of-previous-month/4472/3 "2011-04-05T08:16:49Z")

</div>

Very nice!   
  
 Thanks for the quick and accurate solution Stephen.
