How to subtract 30 days from a date in PowerBuilder?
I have the following code that returns today's date in a parameter, but I need today - 30 days:
dw_1.setitem (1, "begin_datetime", datetime (today (), Now ()))
you are probably looking for a function RelativeDate . Unfortunately, it is required as a parameter Date , not DateTime , but we can work around this:
RelativeDate
Date
DateTime
dw_1.setItem(1, "begin_datetime", DateTime( RelativeDate( today(), -30), Now() )