Error in timesheet report

I need to help with this report please. It is to produce a report for weekly payroll.

Payroll Report for the period <<[Today()-7]>> to <<[Today()]>>

Company

name: <<[name]>>

<<Start:OrderBy(Select([Related Employees][RIC]))>>

Employees

Employee Name: <<[RIC]>><<[Employee Name]>> - <<[Trade]>>
Address: <<[Address]>>, <<[City]>>, <<[Country]>>

Timesheet

RIC Date Time In Verified In Time Out Verified Out Project GPS Total Hours Total Wages
<<Start:OrderBy(Select([Related Time][RIC], AND(([Date] >= (TODAY() - 7)), ([Date] <= TODAY()))))>><<[RIC]>> <<[Date]>> <<[Time In]>> <<[Verified In Time]>> <<[Time Out]>> <<[Verified Out Time]>> <<[Project.Project]>> <<[GPS]>> <<[Total Hours]>> <<[Total Wages]>><>

<>

This is the error that I am getting below.

โ€œErrorsโ€: โ€œError: Report โ€˜Employee Payroll Reportโ€™ action โ€˜Generate Listโ€™ Attachment template. Expression โ€˜[Today()-7]โ€™ is invalid due to: Unable to find column โ€˜Today()-7โ€™. Error: Report โ€˜Employee Payroll Reportโ€™ action โ€˜Generate Listโ€™ Attachment template. Expression โ€˜[Today()]โ€™ is invalid due to: Unable to find column โ€˜Today()โ€™, did you mean โ€˜idโ€™?. Error: Report โ€˜Employee Payroll Reportโ€™ action โ€˜Generate Listโ€™ Attachment template. Expression โ€˜OrderBy(Select([Related Employees][RIC], [Status]= โ€œActiveโ€))โ€™ is invalid due to: ORDERBY has invalid inputs. Error: Report โ€˜Employee Payroll Reportโ€™ action โ€˜Generate Listโ€™ Attachment template. Start expression โ€˜OrderBy(Select([Related Employees][RIC], [Status]= โ€œActiveโ€))โ€™ should generate a List of Ref values. Please verify that it generates a List and that the contents of the List are Ref values. Ref values should come from the โ€˜Keyโ€™ column of the referenced table. Error: Report โ€˜Employee Payroll Reportโ€™ action โ€˜Generate Listโ€™ Body template. Expression โ€˜[Today()-7]โ€™ is invalid due to: Unable to find column โ€˜Today()-7โ€™. Error: Report โ€˜Employee Payroll Reportโ€™ action โ€˜Generate Listโ€™ Body template. Expression โ€˜[Today()]โ€™ is invalid due to: Unable to find column โ€˜Today()โ€™, did you mean โ€˜idโ€™?. Error: Report โ€˜Employee Payroll Reportโ€™ action โ€˜Generate Listโ€™ Body template. Expression โ€˜OrderBy(Select([Related Employees][RIC], [Status]= โ€œActiveโ€))โ€™ is invalid due to: ORDERBY has invalid inputs. Error: Report โ€˜Employee Payroll Reportโ€™ action โ€˜Generate Listโ€™ Body template. Start expression โ€˜OrderBy(Select([Related Employees][RIC], [Status]= โ€œActiveโ€))โ€™ should generate a List of Ref values. Please verify that it generates a List and that the contents of the List are Ref values. Ref values should come from the โ€˜Keyโ€™ column of the referenced table.โ€,

Solved Solved
0 6 369
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

This:

Payroll Report for the period <<[Today()-7]>> to <<[Today()]>>

should be this:

Payroll Report for the period <<Today()-7>> to <<Today()>>

View solution in original post

6 REPLIES 6

Steve
Platinum 4
Platinum 4

This:

Payroll Report for the period <<[Today()-7]>> to <<[Today()]>>

should be this:

Payroll Report for the period <<Today()-7>> to <<Today()>>

Thanks Steve, I have moved from 8 errors to two errors. I deleted the attachment for now.

โ€œErrorsโ€: "Error: Report โ€˜Employee Payroll Reportโ€™ action โ€˜Generate Listโ€™ Body template. Expression โ€˜OrderBy(Select([Related Employees][RIC]))โ€™ is invalid due to: SELECT has invalid inputs.

Error: Report โ€˜Employee Payroll Reportโ€™ action โ€˜Generate Listโ€™ Body template. Start expression โ€˜OrderBy(Select([Related Employees][RIC]))โ€™ should generate a List of Ref values. Please verify that it generates a List and that the contents of the List are Ref values. Ref values should come from the โ€˜Keyโ€™ column of the referenced table.",

Sorry for the delayโ€“Iโ€™ve been out sick.

This:

Select([Related Employees][RIC])

is not a valid SELECT() expression.

You probably donโ€™t need SELECT() at all if the RIC column is of type Ref:

OrderBy([Related Employees][RIC])

Note, too, your ORDERBY() expression dose not indicate which column to order by.

Thank you Steve, I am now error free. I do have two issues or problems based on this templateโ€ฆ

Payroll Report for the period <<Today()-7>> to <<Today()>>

Company

name: <<[name]>>

<<Start:OrderBy([Related Employees][RIC], [employee name], [Status]=โ€œActiveโ€)>>

Employees

Employee Name: <<[RIC]>><<[Employee Name]>> - <<[Trade]>>
Address: <<[Address]>>, <<[City]>>, <<[Country]>>

Timesheet

RIC Date Time In Verified In Time Out Verified Out Project GPS Total Hours Total Wages
<<Start:OrderBy([Related Timesheets][Timestamp], ([Date] > (NOW() - 7)))>><<[RIC]>> <<[Date]>> <<[Time In]>> <<[Verified In Time]>> <<[Time Out]>> <<[Verified Out Time]>> <<[Project].[Project]>> <<[GPS]>> <<[Total Hours]>> <<[Total Wages]>><>

<>

  1. The data is returning all the data in the table and not pay records for the last week. <<Start:OrderBy([Related Timesheets][Timestamp], ( [Date] > (NOW() - 7) ))>><<[RIC]>>

  2. I am getting data returned even if no time was recorded for the user for the period, how do i exclude them from the report?

ORDERBY() merely orders the rows, it doesnโ€™t omit any. What you probably want instead is:

<<Start:OrderBy(Select([Related Timesheets][Timestamp], ([Date] > (NOW() - 7))), [Timetamp])>>

The first <<Start>> expression would need to use SELECT() as well to include only those employees with recorded time. Perhaps something like this:

<<Start:OrderBy(Select([Related Employees][RIC], IsNotBlank(Select([Related Timesheets][Timestamp], ([Date] > (NOW() - 7)))))), [employee name], [Status]=โ€œActiveโ€)>>

Thank you Steve, issues resolved.

Top Labels in this Space