Is this what you're looking for? If not, can you provide some examples?
Start Date:
IF DateTimeDay(Datetimetoday()) = 1 then
datetimeadd(datetimetoday(),-1,"months")
else
datetimefirstofmonth()
endif
End Date:
IF DateTimeDay(Datetimetoday()) = 1 then
datetimeadd(DateTimeLastOfMonth(),-1,"months")
else
DateTimeLastOfMonth()
endif
I know this post was a few years ago now but figured I would offer a solution in case anybody else comes across this issue. You already have the logic in place to determine if it is the first of the month.
If you are looking to get the date for the first of the previous month it can be accomplished with this:
DateTimeAdd(DateTimeFirstOfMonth(), -1, 'months')
Apologies if it has since been solved