You need to use the month function with a date variable.
Def var i-mo as inte format "99" no-undo.
Def var t-date as date. No-undo.
t-date = today.
i-mo = month(t-date).
Or t-date = date(01,01, year(today).
i-mo = month(t-date)
i-mo = month(orderhed.orderdate).
I used a variable of i-mo and a format of "99" so the value will show with a
leading zero (0) < 10
Does this help?
Carl Peterson
Nexus Software, Inc.
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Kunal Ganguly
Sent: Monday, November 09, 2009 5:26 PM
To: Vantage Yahoo Group
Subject: [Vantage] 4GL code - extract month in calculated field
Hello,
I need help extracting the month from a date field in a calculated field in
a BAQ. Essentially, the pseudo-code is
if date >= 1/1/yyyy and date <= 1/31/yyyy then "January"
else if date >= 2/1/yyyy and date <= 2/29/yyyy then "February"
and so on...
There seems to be a function called MONTH(mm/dd/yyyy) in 4GL but i get an
error with that, if there is a way to make this work it would be the ideal
solution.
Thanks,
Kunal
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
Def var i-mo as inte format "99" no-undo.
Def var t-date as date. No-undo.
t-date = today.
i-mo = month(t-date).
Or t-date = date(01,01, year(today).
i-mo = month(t-date)
i-mo = month(orderhed.orderdate).
I used a variable of i-mo and a format of "99" so the value will show with a
leading zero (0) < 10
Does this help?
Carl Peterson
Nexus Software, Inc.
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Kunal Ganguly
Sent: Monday, November 09, 2009 5:26 PM
To: Vantage Yahoo Group
Subject: [Vantage] 4GL code - extract month in calculated field
Hello,
I need help extracting the month from a date field in a calculated field in
a BAQ. Essentially, the pseudo-code is
if date >= 1/1/yyyy and date <= 1/31/yyyy then "January"
else if date >= 2/1/yyyy and date <= 2/29/yyyy then "February"
and so on...
There seems to be a function called MONTH(mm/dd/yyyy) in 4GL but i get an
error with that, if there is a way to make this work it would be the ideal
solution.
Thanks,
Kunal
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]