1

I am using these two local variables in Outsystems that returns the first day of current month and current year and the other one returns the last day of current month and current year.

FirstDayMonth - NewDate(Year(CurrDate()),Month(CurrDate()),1)

LastdayMonth- AddDays(AddMonths(NewDate(Year(CurrDate()),Month(CurrDate()),1),1),-1)

What do I like to know is how can I return the same day, same month but with last year? I want to do the same tin the two variables.

Thank you

Mara Pimentel
  • 317
  • 1
  • 8
  • 14
  • Just for reference, I’d like suggest suggest a couple of alternatives for these functions which I think might read a bit better: `FirstDay = AddDays(CurrDate(), 1 - Days(CurrDate()))` and `LastDay = AddDays(AddMonth(CurrDate(), 1), -Days(CurrDate()))` – Hugo Ferreira Jan 05 '16 at 10:28

1 Answers1

5

You can do it this way: AddYears(yourdate, -1)

pipo
  • 378
  • 1
  • 8