and from there I'm baffled as to why that doesn't work??
Any ideas much appreciated
I can't really post the app unfortunately
Subroutine (credit to Rob Wunderlich I believe) used to generate the [DSBPrintExpiry Period] field and others........
I call the below subroutine with:-
// Call Calendar Generator for field DSB Print Expiry Date CALL CalendarFromField('DSB Print Expiry Date', 'DSBPrintExpiryCalendar', 'DSBPrintExpiry ');
SUB CalendarFromField(_field, _calendar, _prefix) [$(_calendar)]: // Generate Final Calendar LOAD [$(_field)] ,year([$(_field)]) as [$(_prefix)Year] ,month([$(_field)]) as [$(_prefix)Month] ,day([$(_field)]) as [$(_prefix)Day] ,weekday([$(_field)]) as [$(_prefix)Weekday] ,month([$(_field)]) & ' ' & year([$(_field)]) as [$(_prefix)Period] ; // Generate range of dates between min and max. LOAD date(DateMin + IterNo()) as [$(_field)] // Link Field WHILE DateMin + IterNo() <= DateMax ; // Find min and max of date field values. LOAD min(datefield)-1 as DateMin ,max(datefield) as DateMax ; // Load date field values. LOAD FieldValue('$(_field)', RecNo()) as datefield AutoGenerate FieldValueCount('$(_field)');