Ray sent me an email with the following code for a field:
profilename := "Page Usage Count";
docid := @Text(@DocumentUniqueID);
timestamp := @Now;
count := @GetProfileField(profilename; "Count"+docid);
@If(count="";
@Do(@Set("count";1); @SetProfileField(profilename; "TimeStamp"+docid; timestamp)); <br/>
@Do(@Set("timestamp";@GetProfileField(profilename; "TimeStamp"+docid)); @Set("count"; count+1))); <br/>
@SetProfileField(profilename; "Count"+docid; count);
"This page has been accessed " + @Text(count) + " times since " + @Text(timestamp; "D0T1S2")