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

formula field reference problem

Status
Not open for further replies.

jbhg

Programmer
Dec 2, 2004
1
US
ok so what i want to do is use a field in my database called mins_worked to find if a person is working more or less than 40 hrs/week. this is the first time i ever use a formula in a report and i keep getting the message "Fields Cannot be used within a custom function". what should i do?
my function is

Function ()
{table.minutes_worked} - 480

i am doing this useing CR9
 
Not knowing any technical information, it would be hard to second guess what you need

Database and Connectivity
Sample Data
Expected Output

Just guessing from your post, create a formula by clicking on Insert -> Field Object to get the Field Explorer. Click Formula to get to the formula editor and enter the following

//@Worked
{table.minutes_worked} - 480

From the field explorer, click and drag the Worked to the detail section

Cheers,

-LW

 
I'd do it as a formula field saying
Code:
If {table.minutes_worked} >= 480 then "40 or more"
else "Less than 40"
- assuming that you want to include those doing exactly 40 hours with those who do more.

I would then group using the formula field, which separates the two. You could do a test in record selection, if you only want to see one category on your report.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top