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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Academic Scheduler Need to identify differences in meeting Patterns

Status
Not open for further replies.

DeShaun

Technical User
Mar 3, 2017
16
0
0
US
I need assistance with with writing or script or creating formula fields that would help me to quickly identify schedule offenses by meeting patterns days and times.

The goal is to identify the following.

If day is MWF the course time should be 50mins
If day is TR the course time should be 75mins
 
There is a Crystal Reports function that will return the week day number (i.e. will return 1 if the date is a Sunday). It is called DayOfWeek and it takes a date as a parameter. I do not know if this what you are looking for.
 
I was just reading up on that function, but I don't think it will give me what I need.

The field for days of the week are separate.
AS_CATALOG_SCHEDULE.MONDAY_IND1
AS_CATALOG_SCHEDULE.TUESDAY_IND1
AS_CATALOG_SCHEDULE.WEDNESDAY_IND1
AS_CATALOG_SCHEDULE.THURSDAY_IND1
AS_CATALOG_SCHEDULE.FRIDAY_IND1

I have created a field through the expert that allows me CONCATENATE the fields through multiple if statements. Would this function still work.

example
f (
NOT IsNull({AS_CATALOG_SCHEDULE.MONDAY_IND1}) and IsNull({AS_CATALOG_SCHEDULE.TUESDAY_IND1})and isnull ({AS_CATALOG_SCHEDULE.WEDNESDAY_IND1}) and isnull ({AS_CATALOG_SCHEDULE.THURSDAY_IND1}) and isnull ({AS_CATALOG_SCHEDULE.FRIDAY_IND1})
)
then
{AS_CATALOG_SCHEDULE.MONDAY_IND1}

I am attempting to write a statement that would look like the following
If {Days} = "MWF" then
IF {Time} <> "8:00 - 8:50" then
"Fail"
else
""
This would be done for multiple meeting patterns
 
You could use one formula to tag failures:
datetimevar st := datetime(currentdate, time(split({schedtime},"-")[1]));
datetimevar end := datetime(currentdate, time(split({schedtime},"-")[2]));
numbervar dur := datediff("n",st,end);

if
(
(
not isnull({AS_CATALOG_SCHEDULE.MONDAY_IND1}) or
not isnull({AS_CATALOG_SCHEDULE.WEDNESDAY_IND1}) or
not isnull({AS_CATALOG_SCHEDULE.FRIDAY_IND1})
) and
dur<>50
) or
(
(
not isnull({AS_CATALOG_SCHEDULE.TUESDAY_IND1}) or
not isnull({AS_CATALOG_SCHEDULE.THURSDAY_IND1})
) and
dur<>75
) then
"Fail"

-LB
 
I have attempted to add this the full formula above, but I am receiving an error to many arguments for the function.

datetimevar st := datetime(currentdate, time(({AS_CATALOG_SCHEDULE.BEGIN_TIME1},"-")[1]));
datetimevar end := datetime(currentdate, time(({AS_CATALOG_SCHEDULE.END_TIME1},"-")[2]));
numbervar dur := datediff("n",st,end);
 
You showed time as a single string field like this: "8:00-8:50" and the formula was based on that. Your field names now seem to show that there is a start time and an end time. Are they time data types? Or Strings? How do they each display?

-LB
 
I have two the field shown in example two is a datatype the field shown in example 1 is a concatenated field of the two datatypes listed of above.
 
What kind of fields are they? Times? Or Strings?

If they are already time data types, then you can just change the variables like this:

Datetimevar st := datetime(currentdate,{AS_CATALOG_SCHEDULE.BEGIN_TIME_1});

Repeat for end variable. The final line would remain the same.

If they are strings, not times, then use:

Datetimevar st := datetime(currentdate, time({AS_CATALOG_SCHEDULE.BEGIN_TIME_1}));

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top