Results 1 to 3 of 3

Thread: [RESOLVED] Access 2003 - Calculations In A Report

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    111

    Resolved [RESOLVED] Access 2003 - Calculations In A Report

    Hi All,

    I am trying to create a field which will display how much an employee has been paid by using the "hours worked" * "payrate" fields.

    Using the code below returns "#Error" in the report.

    Code:
    =CCur([PayRate] * [Hours Worked])
    The DataType For PayRate Is "Currency" and Hours worked is "Number". I would also like to create a total field for employee payments made but using the below code returns "#Error"

    Code:
    =Sum([PayRate])

  2. #2
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: Access 2003 - Calculations In A Report

    If [PayRate] is Null or [Hours Worked] is Null then [PayRate] * [Hours Worked] is Null and CCur(Null) gives an #Error. Change it to:
    Code:
    =CCur(Nz([PayRate],0) * Nz([Hours Worked],0))
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    111

    Re: Access 2003 - Calculations In A Report

    Cheers anhn for the suggestion. I took a different approach and used the summing function in my SQL query As for the total's, I was placing them in the wrong area of the report design

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width