P
PeterM
I have the following on a form in AC2003.
txAlarmTime is in general format "mm/dd/yyyy hh:mm:ss ampm"
Dim tmpMinuteDifference, tmpHourDifference, tmpDayDifference,
tmpYearDifference As Variant
tmpMinuteDifference = DateDiff("n", Format(Me.AP_Start_Time,
"hh:mm:ss"), Format(Me.txAlarmTime, "hh:mm:ss"))
MsgBox tmpMinuteDifference & " minutes"
tmpHourDifference = DateDiff("h", Format(Me.AP_Start_Time, "hh:mm:ss"),
Format(Me.txAlarmTime, "hh:mm:ss"))
MsgBox tmpHourDifference & " hours"
tmpDayDifference = DateDiff("d", Format(Me.AP_Start_Date, "mm/dd/yyyy"),
Format(Me.txAlarmTime, "mm/dd/yyyy"))
MsgBox tmpDayDifference & " days"
tmpYearDifference = DateDiff("yyyy", Format(Me.AP_Start_Date,
"mm/dd/yyyy"), Format(Me.txAlarmTime, "mm/dd/yyyy"))
MsgBox tmpYearDifference & " years"
if AP_State_Date = 1/6/2010 and txAlarmTime = "1/6/2010 08:45:00"
then tmpMinuteDifference = -15 and tmpHourDifference = -1 and
tmpDayDifference = 0 and tmpYearDifference = 0
why is the tmpHourDifference -1?
Likewise if AP_Start_Date = "1/7/2009" and txAlarmTime = "1/6/2010 09:00:00
am" then tmpMinuteDifference = 0 and tmpHourDifference = 0 and
tmpDayDifference = -364 and tmpYearDifference = -1
why is tmpYearDifference -1?
Thanks for any help you can offer!
txAlarmTime is in general format "mm/dd/yyyy hh:mm:ss ampm"
Dim tmpMinuteDifference, tmpHourDifference, tmpDayDifference,
tmpYearDifference As Variant
tmpMinuteDifference = DateDiff("n", Format(Me.AP_Start_Time,
"hh:mm:ss"), Format(Me.txAlarmTime, "hh:mm:ss"))
MsgBox tmpMinuteDifference & " minutes"
tmpHourDifference = DateDiff("h", Format(Me.AP_Start_Time, "hh:mm:ss"),
Format(Me.txAlarmTime, "hh:mm:ss"))
MsgBox tmpHourDifference & " hours"
tmpDayDifference = DateDiff("d", Format(Me.AP_Start_Date, "mm/dd/yyyy"),
Format(Me.txAlarmTime, "mm/dd/yyyy"))
MsgBox tmpDayDifference & " days"
tmpYearDifference = DateDiff("yyyy", Format(Me.AP_Start_Date,
"mm/dd/yyyy"), Format(Me.txAlarmTime, "mm/dd/yyyy"))
MsgBox tmpYearDifference & " years"
if AP_State_Date = 1/6/2010 and txAlarmTime = "1/6/2010 08:45:00"
then tmpMinuteDifference = -15 and tmpHourDifference = -1 and
tmpDayDifference = 0 and tmpYearDifference = 0
why is the tmpHourDifference -1?
Likewise if AP_Start_Date = "1/7/2009" and txAlarmTime = "1/6/2010 09:00:00
am" then tmpMinuteDifference = 0 and tmpHourDifference = 0 and
tmpDayDifference = -364 and tmpYearDifference = -1
why is tmpYearDifference -1?
Thanks for any help you can offer!