Thanks, Guys
CALVLUE and USERSTARTDATECAL_g are in Ticks
OffSet=1
'Get the True day index regardless of time
date1= date(CALVLUE)
date2=date(USERSTARTDATECAL_g)
newdate1=DateParse(date1) + (TimeParse("00:00") mod cTicksPerDay)
newdate2=DateParse(date2) + (TimeParse("00:00") mod cTicksPerDay)
if newdate1 >= newdate2 then
TheIndex = Int((newdate1-newdate2)/cTicksPerDay)+OffSet
else
Msgbox ("Please Enter A Date On or After Your Start Date of " &Date(USERSTARTDATECAL_g), Pname$, cMsgBoxOK)
TheIndex=-1
end if
Return TheIndex
:sign0060: It works!!!