JRussell
12th November 2002, 13:48
Hi

Can anyone tell me how to extract the day, month and year from a date field?

I need to find out the number of hours between 2 dates in a date range.

I have used the below func. but I get an error because it expects a number as its first arg and not a variable.

date1 = inputstr.to.date("date.f", "%D001")

Thanks in advance for your help
JR

evesely
12th November 2002, 15:46
Try num.to.date() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_date_time_zones_num_to_date). Your call might be:

ret = num.to.date(date.f, yearno, monthno, dayno)