Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

global date variable error

Status
Not open for further replies.

gaift

Programmer
Jul 10, 2006
74
US
I currently have a database that has dates for employees who have taken some training i then have a relationship between the training course and the interval in which the training suffices for. Some having one year, two year, or more before they have to retake the training. As a supplement i have a script that checks the date the training needs to be renewed/retaken and then if that date is before the current date (which is global for all records obviously) the script will leave a comment in the comment section i have made that says Training needs renewal. So far everything works fine except that i think there is a problem with the current date,
because everything that needs to be renewed from the middle of june and before the script works properly by inserting the comment training needs to be renewed. But for dates mass mid june the script does not insert the comment of a renewal is needed, so the script should work for all days before and up to today. I thought there was an error of what was being entered as a global date but when i printed what the global date was it was correct.

Does anyone know what the problem is.
 
Why is your current date a global ?

What is your exact calculation/script to have the next training date ?
 
i have no idea why its global the seniron Computer enginner intern left the project unfinished and when i became the new intern i was given to finish his project.

and the calculation is more or less

pseduo code,

if(traning expiration date < current date)
comments.setField("Training Needs Renewal")

(pseudo java/C++ code assuming comments is an object (in this case a field in filemaker, setField a method, and training needs renewal the parameter.)

it pretty much needs to do that for all the repeating fields which it does unfortunately it doesnt do that for all the current dates.

I apologize for my late replies, as ive said im an intern and during the school year i dont work as much hours so i dont ahve enough time to read the posts, but please posts freely i will read and reply asap,

thank you
 
Just a calculation for the renewal date is probably not enough.
Better would be to look at the requirements for the training session.
Is it intern in the company or extern.
What is the enrollmentperiod prior to the training session.
Is there a need to adapt the 'productionplanning' or the personelplanning, when a member is 'out' for training. ec.

All those things takes time.
Making just an alert date for the training can be not enough, you have to calculate a allert 'period'.

I don't know your structure, but make sure that somewhere in the solution is a place to allert some user about an upcoming training for a given member.

You could start in the training table where you have the training interval.

This period couls serve as base for the calculation for the next trianing. Lok at it as a due letter for payments.
You could make the result of the calculation a containerfield with colors.
Green = still ok
Yellow = this month
Blue = - 14 days
Red = this week

Can you give us more detals about the 'repeating fields' ?
Using a repeating field for date manipulation is not such a go idea.
Better would be to look for a relational aproach.
 
Ok so far this is the main structure
the info on the training is on a completely different table,
and each training course has a time interval which seems to work fine when i input dates the correct renewal date shows up automatically, when a training is about to expire the comment section says something of the sort that training is about to expire, then if the current date has passed the date the comment section will say the training needs to be renewed.

so far everything works fine except for dates that need to be renewed from the ending half of june up to the present so june 4 2006 renewals work fine and everything before that. anything after june 16 2006(more or less) does not work properly when comparing dates.

the way the repeating field works is that theres one repetition for each training course so theres 75 blank spots that an employee can potentially fill by taking all the safety requirements however employees here work in divisions and dont have to go through all the training just some.

the repeating field works fine as well, i dont check renewals for fields that have the safety training name field blank.

thank you.
 
Then I would check the all the calculations and fields, scripts and relationships etc. involved in the calc for that date.

Is the month of June or half June of some significance in your solution ?
 
no
the only significance it has is that any date passed mid june of this year the calculation does not give the correct output,
anything before works perfectly fine.
 
Can you post the calc, or whatever is triggering the (error) date ?
In your first post you said is is triggered by a script.
Can you post the script ?

Is it only on one computer ?
 
sorry i meant its a script but certain parts of the script have calculations, i.e. the if statements.

here is the script:

Insert Current Date[Training::Global Date]
Set Field[Training::Count;1]
Loop
Exit Loop if[GetRepetition(Training::Course ID; Training::Count = ""]
if[GetRepetition(Training::Renewal Date Safety Training; Training::Count) < Training::Global Date]
Set Field[Training::CountTwo;1]
Go to Field[Training:: Comments]
Loop
Exit Loop if [Training::Count <= Training::CountTwo]
Go To Next Field
Set Field [Training::CountTwo; Training:: CountTwo + 1]
End Loop
Set Field[TextColor ("NEEDS RENEWAL; RGB(255;0;0))]
Else
Set Field[Training::CountTwo;1]
Go to Field[Training::Comments]
Loop
Exit Loop if[Training::Count <= CountTwo]
Go to Next Field
Set Field[Training::CountTwo; Training::CountTwo+1]
End Loop
Set Field[""]
End if
Set Field [Training :: Count; Training::Count +1]
End Loop
 
The [Training::Global Date]seems to be a global field...

Check if the data in this field is the right date.

Is there an 'opening script' to set this date ?
 
thanks for the help the global date wasnt being recalculated everytime it checks. so if its recalculated every time its open the scipt works fine thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top