REETA1967
24th January 2003, 10:43
hi,

i have taken two fields of domain type ( time)

if i am writing sql like
select dmoes200.tmtd - dmoes200.tmfr
from dmoes200

it is giving table not present

if i am writing sql like
select dmoes200.tmtd,dmoes200.tmfr
from dmoes200 then it is working ok

is there any other way to do the samething

bye

morpheus
24th January 2003, 10:52
select dmoes200.tmtd - dmoes200.tmfr

In the SELECT statement, you specify the fields that are present in the table. No calculations!!

Use this -

SELECT dmoes200.tmtd,dmoes200.tmfr
FROM dmoes200
SELECTDO
diff = (dmoes200.tmtd-dmoes200.tmfr)
ENDSELECT

Make sure to declare variable diff with type time.

REETA1967
26th January 2003, 15:30
whatever u have suggested is working fine .
but there is one problem if start time is 16:00 and end time is 00:00
it is giving -ve value which can be taken care by ABS fuction. but result
is wrong it is showing 16hrs but result should come 8 hrs

bye

tools123
26th January 2003, 15:59
I would suggest you debug why it is giving the wrong difference.

If you are sure you have used the right domains for the date
fields, the best option is convert to numbers using
Baan standard date functions.You can look them up under
tools manuals in here or on on your server.

NPRao
26th January 2003, 19:12
Reeta,

The time formats of 00:00 or 16:00 are mostly used in the tools tables. This is the old format, the new date/time formats are using UTC formats for most of the time.

Your example of times are similar to the role data time fields. Those fields have to be calculated based on the tools function - date.num() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_date_time_zones_date_num)