July 02, 2007, 05:14 PM
FrankDutchcreate a small text file with let's say the numbers 1 till 90 and save that file in your baseapp directory
now create a master to read that file (PERIOD.MAS)
The number field is "NUMBER"
DEFINE FILE PERIOD
DATEFIELD/YYMD=TODAY+NUMBER;
END
Now you can table that file and hold the data in a focus file and it has the sequence of the coming 3 months.
With some smart extra defines you can list only the working days.
Join the focus file to your table and do what Darin suggested.
July 03, 2007, 08:47 AM
ETHere is an example to create a file of dates using the car file. You can use any file as long as it has more than the number of days you want to check and use a recordlimit to get the number of dates you need and hold this file.
If I understand your problem correctly you would then need to build a file that has each meeting room and all the possible dates.
room1 date1
room1 date2
...
room9 date1
etc.
This can be done by adding a dummy blank field to the hold file generated with all the possible dates. Then create a file containing each distinct meeting room and another dummy blank field. Join the blank in the meeting room file to all blank in the date file. Now create the above described hold file sorted in meeting room and date order.
Extract a file from your data source that has meeting room and dates used. Join the first file which has every meeting room and date combination possible to the second file that only has the rooms with meeting dates. Print the room/date from the first file where the room/date from the second file is missing should give you what you need.
Good luck
et
DEFINE FILE CAR
CNTR/I9 WITH CAR= LAST CNTR + 1;
STARTDT/MDY WITH CAR='070307';
ALLDATE/MDY=IF CNTR EQ 1 THEN STARTDT ELSE LAST ALLDATE + 1;
END
TABLEF FILE CAR
PRINT CAR ALLDATE
END
CAR ALLDATE
--- -------
JAGUAR 07/03/07
JENSEN 07/04/07
TRIUMPH 07/05/07
PEUGEOT 07/06/07
ALFA ROMEO 07/07/07
MASERATI 07/08/07
DATSUN 07/09/07
TOYOTA 07/10/07
AUDI 07/11/07
BMW 07/12/07