Function Trouble

  • Thread starter Thread starter Chris Nebinger
  • Start date Start date
C

Chris Nebinger

Well, if you set the pmLastDate to a Date/Time field, then
it would go easier.

In a query:
NextDue:DateAdd(PMUnit,PMLastDate)

OR:

NextDue:DateAdd(PMUnit,PMLastDate + PMLastHours)


Chris Nebinger
-----Original Message-----
Good morning,
I've recently started developing a Maintenance Scheduling
and Parts Inventory application and am working out a small
function. I have a table with the following fields:
SysID (text, 2char)
PMLastDate (short date)
PMLastHrs (double)
PMFreq (byte)
PMUnit (text, 10char)

I need to calculate the NEXT PM based on the
information. If a piece of equipment calls for
preventative maintenance every 300 hours (operating time,
not chronos time), then I need to add 300 to the
PMLastHours for my next field (NEXTPM). However, if my PM
is based on 3 months, or 90 days, then I need to dateadd
3m or 90d to my PMLastDate.
The crux is that I cannot seem to dim my function
(freqtiming) based on my frequency unit. The compiler
doesn't like a dim in the middle of an if block. Can
someone help? Thanks in advance.
 
Thanks, Chris. I thought that short date WAS a date/time field... Is this wrong

Dere

----- Chris Nebinger wrote: ----

Well, if you set the pmLastDate to a Date/Time field, then
it would go easier

In a query
NextDue:DateAdd(PMUnit,PMLastDate

OR:

NextDue:DateAdd(PMUnit,PMLastDate + PMLastHours


Chris Nebinge
-----Original Message----
Good morning
I've recently started developing a Maintenance Scheduling
and Parts Inventory application and am working out a small
function. I have a table with the following fields
PMLastDate (short date
PMLastHrs (double
PMFreq (byte
PMUnit (text, 10char
information. If a piece of equipment calls for
preventative maintenance every 300 hours (operating time,
not chronos time), then I need to add 300 to the
PMLastHours for my next field (NEXTPM). However, if my PM
is based on 3 months, or 90 days, then I need to dateadd
3m or 90d to my PMLastDate.(freqtiming) based on my frequency unit. The compiler
doesn't like a dim in the middle of an if block. Can
someone help? Thanks in advance
 
Back
Top