pjohns
25th March 2004, 12:36
Hello,

I have created a condition script against an Exchange scheme but I'm not sure on what syntax I need to use for date fields.

I have tried the following, which compiles but does filter my records by those with an order date greater = to 01-01-2004.

if tdsls040.odat >= 01012004 then

valid = 1

else

valid = 0

endif
return(valid)


Any ideas?

Thanks

PJ

en@frrom
25th March 2004, 13:22
Hi PJ,

The field tdsls040.odat = a utc-format field. So you first need to get the utc-value of 01/01/2004 by using the function date.to.utc(), and then compare it with tdsls040.odat.

Like this:
docd.utc = date.to.utc(2004, 01, 01, 00, 00, 00)
if tdsls040.odat >= docd.utc then
valid = 1
else
valid = 0
endif
return(valid)

Hope this helps.

Good luck!!

En.

skosana
29th March 2004, 21:18
I thought date.to.num(2004,01,01) would be more simple.

lbencic
30th March 2004, 00:15
Rule of thumb, based on the tcdate domain:

Baan IV and lower uses date.to.num and the other *.num date functions.

Baan V and higher uses date.to.utc and other *.utc date functions.

pjohns
30th March 2004, 09:56
...for your help and input.

date.to.num was indeed the function I was looking for.

Kind regards

PJ

en@frrom
30th March 2004, 10:32
In Baan ERP you need to use date.to.utc, because the domain tcdate is a utc-domain, and the return value of date.to.num is the number of days (for dte domain).

From Lisa I understand that in Baan IV the domain tcdate is non-utc, but just a regular date format?

Regards,

En.

lbencic
30th March 2004, 17:40
That's right En..Baan IV tcdate is not UTC. It still is an unrecognizable number - something like the number of days since some day. The date and time are stored as separate fields.
They have introduced the utc domain in Baan IV recently, but I think mostly for their porting solutions to Baan V.