Jeff
Jeff

Reputation: 8148

Powerbuilder Date Math

How do I 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()))

Upvotes: 1

Views: 3797

Answers (1)

ninesided
ninesided

Reputation: 23273

you're probably looking for the RelativeDate function. Unfortunately, it takes a Date and not a DateTime as a parameter, but we can get around that:

dw_1.setItem(1, "begin_datetime", DateTime( RelativeDate( today(), -30), Now() )

Upvotes: 7

Related Questions