> A couple of questions from a newbie, so apologies if these have been
> asked before:
> 1. I want to do a slight variation of the LeftWords function but I'm not
> sure if it's possible. I want to look for a specified text string, but
> then get the function to output the first word to the left of the search
> string. For example if I had a text string "I have 10 apples" and I
> searched for "apples" the function would return "10". The point is that
> the number in this case will vary, so I can't include it in the search
> string. Any ideas?
Say you have a global into which you will type the text you are looking
Create calc fields:
NewEndText = Position(text; Global; 1; 1)-2 [Minus 2 to account for
the first letter of "apple" and the space before "apple".]
NewText = Left(text; NewEndText)
gives just "I have 10".
Final calc = RightWords(Newtext;1)
You could amalgamate these fields into one calc.
> 2. I'm having a problem with a time calculation. I have 2 time fields,
> and I'm trying to subtract a time interval from a specific point in
> time. This works fine unless the calculation crosses over a 24hr period.
> For example, if I have a time of 02:00 and I want to subtract 3 hours
> from that, I get a reult of -01:00 rather than 23:00. Is there a way
> around this?
Not sure of my ground on this one, but you could have a further calc
It's + the calc because it will be a minus value as you have discovered.