How did you calculate the week number? Or is that just entered data - if so, what is the format? (Filemaker has funny ideas about what the week number is.)
In its simplest form you could use set the fields to be:
">=" & Year ( Get (CurrentDate ) )
">=" & WeekOfYear ( Get (CurrentDate ) )
but I would use WeekOfYearFiscal ( Get (CurrentDate ) ; 2 )
The Week and Year numbers are just numbers. not Calculations. They live in separate WEEk and YEAR fields in the DB
They are the result of a very nice script that PhilModJunk described for me here at the forum
See below ...Work Shifts Calender24 Views, 1 CommentTitle:Work Shifts CalenderPost:
I have used the FM Tasks DB as a template for a Task Management system for my workplace. I want to include the ability to create a Work Shifts list (not sure if my translation is correct here)
Let me explain ...
I am the leadere of a small workgroup with 7 people, that does IT support for a Video Production system in the News department of a national broadcaster. We work shifts (one week each). All members are already been registered in the Tasks DB Contacts Table
What is the best way to set up a DB that does the following
on January the 1th. each year automatically creates 53 new posts (one for each week of the year) for the next year, so that the Shifts calender can be prepeared in advance ...
Each post must include Year, Week Nr., Name and Replacement fields. The Year and Week nr. fields must be automatically filled with data.
Let's me create 53 posts for a spesific year, to maintain a history record of Shifts
We have old shifts lists that we want to include, so that management can check for awho was in charge on a spesific week on a spesific year
I hope someone can help me
Cheers Nils ...
By "posts" I must assume you mean Records.
The following script checks for the existance of records with the current date's year and creates 53 records if no such records are found:
Enter Find Mode ---clear the pause check box
Set Field[Shifts::Year ; Year ( get ( CurrentDate ) ) ]
Set Error Capture [on] ---keeps "no records found" dialog from interrupting the script
Perform Find 
If [Not Get ( FoundCount ) // no records with this year were found]
Set Variable [$Week ; value: $Week + 1 ]
Exit Loop If [$Week > 53 ]
Set Field [Shifts::Week ; $Week]
Set Field [Shifts::Year ; Year ( Get ( CurrentDate ) ) ]
You can use FileOptions to set this script to run each time that the database is opened, of if you are using FileMaker Server to host the file, you can set it to run once a day with a server schedule.
I already have the WeekOfYearFiscal ( Get (CurrentDate ) ; 2 ) as a field in the DB, to get the NOW value for week.
What I need is to make a list that shows FUTURE SHIFTS assignments ONLY ... where the YEAR is Greater or equal to NOW and the week number is greater than NOW, but will also include al week numbers that are entered for the next year ...
At the moment (i.e. if the NOW week number is 42) i get Week 42-52 of the current year, and week 42-53 of the next year .... no the full next year
The results are shown in a Portal, and the Portal setup is part of the problem here
The Relationship is like
GET YEAR (Current Date) <= YEAR
USERNAME = USERNAME
If i include WEEK i.e. GET WEEK (CurrentDate) < WEEK NUMBER into the relationship i only get Higher than NOW WEEK records shown in the Portal , regardless of the year number.
Hope you understand my problem ;-)
- on January the 1th. each year automatically creates 53 new posts (one for each week of the year) for the next year, so that the Shifts calender can be prepeared in advance ...
Sorry, my fault. Why not combine the year and month into one field, like '201205', and then search for
">=" & Year ( Get (CurrentDate ) ) & Right ( "0" & WeekOfYearFiscal ( Get (CurrentDate ) ; 2 ) ; 2 )