I'm trying to field calculate using a python script the number of business days between two given dates. Right now the dates are hard coded, but once I get the script working I will pass dates from two other fields to it. The script works fine in IDLE, giving me the correct number of business days, but when I put it in the field calculator it errors out:
ERROR 999999: Error executing function
The field is not nullable.
The field is set as "Short" with Precision at 5.
Pre-Logic Script Code:
import datetime as dt
import numpy as np
def workdays():
start = dt.date(2018, 1, 31)
end = dt.date(2018, 2, 12)
days = np.busday_count(start, end)
return days
Field=
workdays()