4GL date calculation

I finally figured out what I needed for the BAQ calc - since it is looking for an expression only, this is what I came up with:

(IF RcvDtl.ReceiptDate >= PORel.DueDate - 3 and RcvDtl.ReceiptDate <= PORel.DueDate + 3
THEN "On Time"
Else (if RcvDtl.ReceiptDate < PORel.DueDate - 3
Then "Early"
Else (if RcvDtl.ReceiptDate > PORel.DueDate + 3
Then "Late"
Else "")))

What
I did'nt know about code in BAQs is the need for the parentheses
(progress code) - so my starting assumptions were wrong, hence some of
the frustrations!!

Thanks,
Kunal




________________________________
From: Mike Anstey <manstey@...>
To: vantage@yahoogroups.com
Sent: Thursday, November 6, 2008 6:23:35 AM
Subject: RE: [Vantage] 4GL date calculation


Make sure you have the colons (:) and the periods (.) or it will not compile.

____________ _________ _________ __

From: vantage@yahoogroups .com on behalf of Kunal Ganguly
Sent: Wed 11/5/2008 5:02 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

I get a syntax error when i goto analyze it, do u have a very very simple working example that just prints something! this is especially frustrating because I am stuck due to a simple code syntax issue!!!!!!! !!

Thanks,
Kunal

____________ _________ _________ __
From: Mike Anstey <manstey@flakeboard. ca <mailto:manstey% 40flakeboard. ca> >
To: vantage@yahoogroups .com <mailto:vantage% 40yahoogroups. com>
Sent: Wednesday, November 5, 2008 2:49:12 PM
Subject: RE: [Vantage] 4GL date calculation

4GL is a little picky...

IF condition 1 THEN DO:

........

END.

ELSE IF condition 2 THEN DO: (You can put in as many of these as you
want)

........

END.

ELSE DO:

.......

END.

____________ _________ _________ __

From: vantage@yahoogroups .com [mailto:vantage@ yahoogroups .com] On Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 4:35 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

if RcvDtl.ReceiptDate > PORel.DueDate - 3 and RcvDtl.ReceiptDate <
PORel.DueDate + 3
Then "On Time"
Else "xxxx"

need the rest of my conditions in there

Thanks,
Kunal

____________ _________ _________ __
From: Dale R. Kalsow <dale.r.kalsow@ determan. com
<mailto:dale. r.kalsow% 40determan. com> >
To: vantage@yahoogroups .com <mailto:vantage% 40yahoogroups. com>
Sent: Wednesday, November 5, 2008 2:31:55 PM
Subject: RE: [Vantage] 4GL date calculation

Post what you have.

From: vantage@yahoogroups .com [mailto:vantage@ yahoogroups .com] On
Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 2:27 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

ok, i figured out the first if, but I am having trouble with the nested
if's. anyone got any pointers?

Thanks,
Kunal

____________ _________ _________ __
From: Kunal Ganguly <kunal_vantage@ yahoo.com
<mailto:kunal_ vantage%40yahoo. com> >
To: Vantage Yahoo Group <vantage@yahoogroup s .com
<mailto:vantage% 40yahoogroups. com> >
Sent: Wednesday, November 5, 2008 1:52:01 PM
Subject: [Vantage] 4GL date calculation

Hello,

Need some help in 4GL on this time. I need to have a calculated field in
a BAQ that compares 2 date fields.

if date1 is within 3 days of date2 (i.e. +/- 3 days), then calculated
field (calc1) = "on time"
if date1 is less than 3 days before date2 then calc1 = "early"
if date1 is greater than 3 days after date2 then calc1 = "late"

for those familiar with receiving module, i am basically trying to write
a report for parts received against Purchase orders placed. I can see
the ontime field in the PO tracker under receipts, but i cannot for the
life of me find where it is stored, hence the calculations. According to
the zdata tables, there is a field called ontime in rcvdtl, but it does
not exist (ontime).

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]

[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]

[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]
Hello,

Need some help in 4GL on this time. I need to have a calculated field in a BAQ that compares 2 date fields.

if date1 is within 3 days of date2 (i.e. +/- 3 days), then calculated field (calc1) = "on time"
if date1 is less than 3 days before date2 then calc1 = "early"
if date1 is greater than 3 days after date2 then calc1 = "late"

for those familiar with receiving module, i am basically trying to write a report for parts received against Purchase orders placed. I can see the ontime field in the PO tracker under receipts, but i cannot for the life of me find where it is stored, hence the calculations. According to the zdata tables, there is a field called ontime in rcvdtl, but it does not exist (ontime).

Thanks,
Kunal





[Non-text portions of this message have been removed]
ok, i figured out the first if, but I am having trouble with the nested if's. anyone got any pointers?

Thanks,
Kunal




________________________________
From: Kunal Ganguly <kunal_vantage@...>
To: Vantage Yahoo Group <vantage@yahoogroups.com>
Sent: Wednesday, November 5, 2008 1:52:01 PM
Subject: [Vantage] 4GL date calculation


Hello,

Need some help in 4GL on this time. I need to have a calculated field in a BAQ that compares 2 date fields.

if date1 is within 3 days of date2 (i.e. +/- 3 days), then calculated field (calc1) = "on time"
if date1 is less than 3 days before date2 then calc1 = "early"
if date1 is greater than 3 days after date2 then calc1 = "late"

for those familiar with receiving module, i am basically trying to write a report for parts received against Purchase orders placed. I can see the ontime field in the PO tracker under receipts, but i cannot for the life of me find where it is stored, hence the calculations. According to the zdata tables, there is a field called ontime in rcvdtl, but it does not exist (ontime).

Thanks,
Kunal

[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]
Post what you have.



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 2:27 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] 4GL date calculation



ok, i figured out the first if, but I am having trouble with the nested
if's. anyone got any pointers?

Thanks,
Kunal

________________________________
From: Kunal Ganguly <kunal_vantage@...
<mailto:kunal_vantage%40yahoo.com> >
To: Vantage Yahoo Group <vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com> >
Sent: Wednesday, November 5, 2008 1:52:01 PM
Subject: [Vantage] 4GL date calculation

Hello,

Need some help in 4GL on this time. I need to have a calculated field in
a BAQ that compares 2 date fields.

if date1 is within 3 days of date2 (i.e. +/- 3 days), then calculated
field (calc1) = "on time"
if date1 is less than 3 days before date2 then calc1 = "early"
if date1 is greater than 3 days after date2 then calc1 = "late"

for those familiar with receiving module, i am basically trying to write
a report for parts received against Purchase orders placed. I can see
the ontime field in the PO tracker under receipts, but i cannot for the
life of me find where it is stored, hence the calculations. According to
the zdata tables, there is a field called ontime in rcvdtl, but it does
not exist (ontime).

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]
if RcvDtl.ReceiptDate > PORel.DueDate - 3 and RcvDtl.ReceiptDate < PORel.DueDate + 3
Then "On Time"
Else "xxxx"


need the rest of my conditions in there

Thanks,
Kunal




________________________________
From: Dale R. Kalsow <dale.r.kalsow@...>
To: vantage@yahoogroups.com
Sent: Wednesday, November 5, 2008 2:31:55 PM
Subject: RE: [Vantage] 4GL date calculation


Post what you have.

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 2:27 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

ok, i figured out the first if, but I am having trouble with the nested
if's. anyone got any pointers?

Thanks,
Kunal

____________ _________ _________ __
From: Kunal Ganguly <kunal_vantage@ yahoo.com
<mailto:kunal_ vantage%40yahoo. com> >
To: Vantage Yahoo Group <vantage@yahoogroups .com
<mailto:vantage% 40yahoogroups. com> >
Sent: Wednesday, November 5, 2008 1:52:01 PM
Subject: [Vantage] 4GL date calculation

Hello,

Need some help in 4GL on this time. I need to have a calculated field in
a BAQ that compares 2 date fields.

if date1 is within 3 days of date2 (i.e. +/- 3 days), then calculated
field (calc1) = "on time"
if date1 is less than 3 days before date2 then calc1 = "early"
if date1 is greater than 3 days after date2 then calc1 = "late"

for those familiar with receiving module, i am basically trying to write
a report for parts received against Purchase orders placed. I can see
the ontime field in the PO tracker under receipts, but i cannot for the
life of me find where it is stored, hence the calculations. According to
the zdata tables, there is a field called ontime in rcvdtl, but it does
not exist (ontime).

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]






[Non-text portions of this message have been removed]
Off the top of my head I would think you need to end your endif
statement.



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 2:35 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] 4GL date calculation



if RcvDtl.ReceiptDate > PORel.DueDate - 3 and RcvDtl.ReceiptDate <
PORel.DueDate + 3
Then "On Time"
Else "xxxx"

need the rest of my conditions in there

Thanks,
Kunal

________________________________
From: Dale R. Kalsow <dale.r.kalsow@...
<mailto:dale.r.kalsow%40determan.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, November 5, 2008 2:31:55 PM
Subject: RE: [Vantage] 4GL date calculation

Post what you have.

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On
Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 2:27 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

ok, i figured out the first if, but I am having trouble with the nested
if's. anyone got any pointers?

Thanks,
Kunal

____________ _________ _________ __
From: Kunal Ganguly <kunal_vantage@ yahoo.com
<mailto:kunal_ vantage%40yahoo. com> >
To: Vantage Yahoo Group <vantage@yahoogroups .com
<mailto:vantage% 40yahoogroups. com> >
Sent: Wednesday, November 5, 2008 1:52:01 PM
Subject: [Vantage] 4GL date calculation

Hello,

Need some help in 4GL on this time. I need to have a calculated field in
a BAQ that compares 2 date fields.

if date1 is within 3 days of date2 (i.e. +/- 3 days), then calculated
field (calc1) = "on time"
if date1 is less than 3 days before date2 then calc1 = "early"
if date1 is greater than 3 days after date2 then calc1 = "late"

for those familiar with receiving module, i am basically trying to write
a report for parts received against Purchase orders placed. I can see
the ontime field in the PO tracker under receipts, but i cannot for the
life of me find where it is stored, hence the calculations. According to
the zdata tables, there is a field called ontime in rcvdtl, but it does
not exist (ontime).

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]

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
4GL is a little picky...



IF condition 1 THEN DO:

......

END.

ELSE IF condition 2 THEN DO: (You can put in as many of these as you
want)

......

END.

ELSE DO:

.....

END.



________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 4:35 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] 4GL date calculation



if RcvDtl.ReceiptDate > PORel.DueDate - 3 and RcvDtl.ReceiptDate <
PORel.DueDate + 3
Then "On Time"
Else "xxxx"

need the rest of my conditions in there

Thanks,
Kunal

________________________________
From: Dale R. Kalsow <dale.r.kalsow@...
<mailto:dale.r.kalsow%40determan.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, November 5, 2008 2:31:55 PM
Subject: RE: [Vantage] 4GL date calculation

Post what you have.

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On
Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 2:27 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

ok, i figured out the first if, but I am having trouble with the nested
if's. anyone got any pointers?

Thanks,
Kunal

____________ _________ _________ __
From: Kunal Ganguly <kunal_vantage@ yahoo.com
<mailto:kunal_ vantage%40yahoo. com> >
To: Vantage Yahoo Group <vantage@yahoogroups .com
<mailto:vantage% 40yahoogroups. com> >
Sent: Wednesday, November 5, 2008 1:52:01 PM
Subject: [Vantage] 4GL date calculation

Hello,

Need some help in 4GL on this time. I need to have a calculated field in
a BAQ that compares 2 date fields.

if date1 is within 3 days of date2 (i.e. +/- 3 days), then calculated
field (calc1) = "on time"
if date1 is less than 3 days before date2 then calc1 = "early"
if date1 is greater than 3 days after date2 then calc1 = "late"

for those familiar with receiving module, i am basically trying to write
a report for parts received against Purchase orders placed. I can see
the ontime field in the PO tracker under receipts, but i cannot for the
life of me find where it is stored, hence the calculations. According to
the zdata tables, there is a field called ontime in rcvdtl, but it does
not exist (ontime).

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]

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
I get a syntax error when i goto analyze it, do u have a very very simple working example that just prints something! this is especially frustrating because I am stuck due to a simple code syntax issue!!!!!!!!!

Thanks,
Kunal




________________________________
From: Mike Anstey <manstey@...>
To: vantage@yahoogroups.com
Sent: Wednesday, November 5, 2008 2:49:12 PM
Subject: RE: [Vantage] 4GL date calculation


4GL is a little picky...

IF condition 1 THEN DO:

.......

END.

ELSE IF condition 2 THEN DO: (You can put in as many of these as you
want)

.......

END.

ELSE DO:

......

END.

____________ _________ _________ __

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 4:35 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

if RcvDtl.ReceiptDate > PORel.DueDate - 3 and RcvDtl.ReceiptDate <
PORel.DueDate + 3
Then "On Time"
Else "xxxx"

need the rest of my conditions in there

Thanks,
Kunal

____________ _________ _________ __
From: Dale R. Kalsow <dale.r.kalsow@ determan. com
<mailto:dale. r.kalsow% 40determan. com> >
To: vantage@yahoogroups .com <mailto:vantage% 40yahoogroups. com>
Sent: Wednesday, November 5, 2008 2:31:55 PM
Subject: RE: [Vantage] 4GL date calculation

Post what you have.

From: vantage@yahoogroups .com [mailto:vantage@ yahoogroups .com] On
Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 2:27 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

ok, i figured out the first if, but I am having trouble with the nested
if's. anyone got any pointers?

Thanks,
Kunal

____________ _________ _________ __
From: Kunal Ganguly <kunal_vantage@ yahoo.com
<mailto:kunal_ vantage%40yahoo. com> >
To: Vantage Yahoo Group <vantage@yahoogroup s .com
<mailto:vantage% 40yahoogroups. com> >
Sent: Wednesday, November 5, 2008 1:52:01 PM
Subject: [Vantage] 4GL date calculation

Hello,

Need some help in 4GL on this time. I need to have a calculated field in
a BAQ that compares 2 date fields.

if date1 is within 3 days of date2 (i.e. +/- 3 days), then calculated
field (calc1) = "on time"
if date1 is less than 3 days before date2 then calc1 = "early"
if date1 is greater than 3 days after date2 then calc1 = "late"

for those familiar with receiving module, i am basically trying to write
a report for parts received against Purchase orders placed. I can see
the ontime field in the PO tracker under receipts, but i cannot for the
life of me find where it is stored, hence the calculations. According to
the zdata tables, there is a field called ontime in rcvdtl, but it does
not exist (ontime).

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]

[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]
Why the need to do it in 4GL? Why not just write a BAQ to return an appropriate time bucket's worth of PO receipts and set up it up as a recurring process set export?

Then you could do your analysis in about 30 seconds in excel. (Heck, you could task schedule the excel app in synch with your BAQ export schedule and set it up with an Auto_Open vbscript to execute automatically and spit out hard copy or save itself for later review).

...Use a railroad spike when thumbtack will do?

Rob



--- On Wed, 11/5/08, Dale R. Kalsow <dale.r.kalsow@...> wrote:

From: Dale R. Kalsow <dale.r.kalsow@...>
Subject: RE: [Vantage] 4GL date calculation
To: vantage@yahoogroups.com
Date: Wednesday, November 5, 2008, 3:31 PM






Post what you have.

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 2:27 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

ok, i figured out the first if, but I am having trouble with the nested
if's. anyone got any pointers?

Thanks,
Kunal

____________ _________ _________ __
From: Kunal Ganguly <kunal_vantage@ yahoo.com
<mailto:kunal_ vantage%40yahoo. com> >
To: Vantage Yahoo Group <vantage@yahoogroups .com
<mailto:vantage% 40yahoogroups. com> >
Sent: Wednesday, November 5, 2008 1:52:01 PM
Subject: [Vantage] 4GL date calculation

Hello,

Need some help in 4GL on this time. I need to have a calculated field in
a BAQ that compares 2 date fields.

if date1 is within 3 days of date2 (i.e. +/- 3 days), then calculated
field (calc1) = "on time"
if date1 is less than 3 days before date2 then calc1 = "early"
if date1 is greater than 3 days after date2 then calc1 = "late"

for those familiar with receiving module, i am basically trying to write
a report for parts received against Purchase orders placed. I can see
the ontime field in the PO tracker under receipts, but i cannot for the
life of me find where it is stored, hence the calculations. According to
the zdata tables, there is a field called ontime in rcvdtl, but it does
not exist (ontime).

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]
Make sure you have the colons (:) and the periods (.) or it will not compile.

________________________________

From: vantage@yahoogroups.com on behalf of Kunal Ganguly
Sent: Wed 11/5/2008 5:02 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] 4GL date calculation



I get a syntax error when i goto analyze it, do u have a very very simple working example that just prints something! this is especially frustrating because I am stuck due to a simple code syntax issue!!!!!!!!!

Thanks,
Kunal

________________________________
From: Mike Anstey <manstey@... <mailto:manstey%40flakeboard.ca> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, November 5, 2008 2:49:12 PM
Subject: RE: [Vantage] 4GL date calculation

4GL is a little picky...

IF condition 1 THEN DO:

.......

END.

ELSE IF condition 2 THEN DO: (You can put in as many of these as you
want)

.......

END.

ELSE DO:

......

END.

____________ _________ _________ __

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 4:35 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

if RcvDtl.ReceiptDate > PORel.DueDate - 3 and RcvDtl.ReceiptDate <
PORel.DueDate + 3
Then "On Time"
Else "xxxx"

need the rest of my conditions in there

Thanks,
Kunal

____________ _________ _________ __
From: Dale R. Kalsow <dale.r.kalsow@ determan. com
<mailto:dale. r.kalsow% 40determan. com> >
To: vantage@yahoogroups .com <mailto:vantage% 40yahoogroups. com>
Sent: Wednesday, November 5, 2008 2:31:55 PM
Subject: RE: [Vantage] 4GL date calculation

Post what you have.

From: vantage@yahoogroups .com [mailto:vantage@ yahoogroups .com] On
Behalf
Of Kunal Ganguly
Sent: Wednesday, November 05, 2008 2:27 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] 4GL date calculation

ok, i figured out the first if, but I am having trouble with the nested
if's. anyone got any pointers?

Thanks,
Kunal

____________ _________ _________ __
From: Kunal Ganguly <kunal_vantage@ yahoo.com
<mailto:kunal_ vantage%40yahoo. com> >
To: Vantage Yahoo Group <vantage@yahoogroup s .com
<mailto:vantage% 40yahoogroups. com> >
Sent: Wednesday, November 5, 2008 1:52:01 PM
Subject: [Vantage] 4GL date calculation

Hello,

Need some help in 4GL on this time. I need to have a calculated field in
a BAQ that compares 2 date fields.

if date1 is within 3 days of date2 (i.e. +/- 3 days), then calculated
field (calc1) = "on time"
if date1 is less than 3 days before date2 then calc1 = "early"
if date1 is greater than 3 days after date2 then calc1 = "late"

for those familiar with receiving module, i am basically trying to write
a report for parts received against Purchase orders placed. I can see
the ontime field in the PO tracker under receipts, but i cannot for the
life of me find where it is stored, hence the calculations. According to
the zdata tables, there is a field called ontime in rcvdtl, but it does
not exist (ontime).

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]

[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]






[Non-text portions of this message have been removed]