4GL code - extract month in calculated field

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]
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]
AnswerBook #:

3643ESC



This may have what you need, but I am not sure...



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Kunal Ganguly
Sent: Monday, November 09, 2009 4: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]
I've used the month function in a BAQ with no error. The function returns an integer (1-12). What data type are you using?

--- In vantage@yahoogroups.com, Kunal Ganguly <kunal_vantage@...> wrote:
>
> 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]
>
Karen,

You are my favorite person of the day today!!! :) Thanks a ton!!

-Kunal




________________________________
From: Karen Schoenung <kschoenung@...>
To: vantage@yahoogroups.com
Sent: Mon, November 9, 2009 4:31:43 PM
Subject: RE: [Vantage] 4GL code - extract month in calculated field


AnswerBook #:

3643ESC

This may have what you need, but I am not sure...

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf
Of Kunal Ganguly
Sent: Monday, November 09, 2009 4: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]







[Non-text portions of this message have been removed]
This is what I ended up with

entry( Month( OrderHed.RequestDate), 'January, February, March, April, May, June, July, August, September, October, November, December') + ", " + string(Year(OrderHed.RequestDate), "9999")


Initially, I was leaving out the entry() part.
Thanks,
Kunal




________________________________
From: Kirstin <kirstin.brandt@...>
To: vantage@yahoogroups.com
Sent: Mon, November 9, 2009 4:47:29 PM
Subject: [Vantage] Re: 4GL code - extract month in calculated field


I've used the month function in a BAQ with no error. The function returns an integer (1-12). What data type are you using?

--- In vantage@yahoogroups .com, Kunal Ganguly <kunal_vantage@ ...> wrote:
>
> 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]