camste
17th August 2009, 16:22
Hi everyone,
I'm sort of a novice when it comes to Baan scripting, and now I have a problem when trying to calculate a date. I need to find the first of the month as a date, so that I can use it to compare to a date in a query. This is what I have tried:
extern domain tcdate curr.mois
long curr.day
curr.day = load.long(date$(1;2))
curr.mois = date.num() - curr.day + 1
The problem is that I always get 0 as the day number (curr.day), and when subtracting that from curr.mois, I always get a blank value. When I try to assign date$ to a string variable and show it in the report it always appears as blank. Is there some special setting which must be set so that I can be able to use this standard variable? Is there another way I can do this? Does Baan have any built in functions like Oracle's trunc for dates for instance?
I'm sort of a novice when it comes to Baan scripting, and now I have a problem when trying to calculate a date. I need to find the first of the month as a date, so that I can use it to compare to a date in a query. This is what I have tried:
extern domain tcdate curr.mois
long curr.day
curr.day = load.long(date$(1;2))
curr.mois = date.num() - curr.day + 1
The problem is that I always get 0 as the day number (curr.day), and when subtracting that from curr.mois, I always get a blank value. When I try to assign date$ to a string variable and show it in the report it always appears as blank. Is there some special setting which must be set so that I can be able to use this standard variable? Is there another way I can do this? Does Baan have any built in functions like Oracle's trunc for dates for instance?