Records from today in report

Good afternoon. I am trying to create a summary report for all records created โ€œtodayโ€ and exclude any records before โ€œtodayโ€. All my records are timestamped with date and time and I have this as my start expression.

<<Start: Select(Enter a Catch[Timestamp=TODAY()], TRUE)>>

When I fire the report, it gives me the following error
โ€œErrorsโ€: โ€œError: Workflow rule โ€˜New Reportโ€™ action โ€˜Email Reportโ€™ Body template. Expression โ€˜Select(Enter a Catch[Timestamp=TODAY()], TRUE)โ€™ is invalid due to: Unable to find column โ€˜Timestamp=TODAY()โ€™. Error: Workflow rule โ€˜New Reportโ€™ action โ€˜Email Reportโ€™ Body template. Start expression โ€˜Select(Enter a Catch[Timestamp=TODAY()], TRUE)โ€™ 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: Workflow rule โ€˜New Reportโ€™ action โ€˜Email Reportโ€™ Body template. Start expression โ€˜Select(Enter a Catch[Timestamp=TODAY()], TRUE)โ€™ 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.โ€,

If I donโ€™t have =TODAY() in it, the report fires the entire table.
Thanks

Solved Solved
0 4 903
1 ACCEPTED SOLUTION

Your original expression:

Select(Enter a Catch[Timestamp=TODAY()], TRUE)

is invalid because AppSheet treats everything between the square brackets as a column name, but your column is not named Timestamp=TODAY().

Your revised expression:

Select(Enter a Catch[Timestamp]=โ€TODAY()โ€, TRUE)

is invalid because the first argument is an expression (Enter a Catch[Timestamp]=โ€TODAY()โ€) when it should be just a column specification (e.g., Enter a Catch[Timestamp]). Not strictly invalid, but probably not what you really want: the TODAY() function is in quotes, making it a literal Text value. You probably donโ€™t want to compare a timestamp to the literal text.

What you probably want:

Select(Enter a Catch[Timestamp],[Timestamp]=TODAY())

Or:

FILTER("Enter a Catch", ([Timestamp] = TODAY()))

These suggested SELECT() and FILTER() expressions are equivalent, but I prefer FILTER() because it returns the row keys automatically so you donโ€™t have to specify the key column.

If the Timestamp column is of type DateTime, use DATE([Timestamp]) instead of just [Timestamp] in the above, like this:

FILTER("Enter a Catch", (DATE([Timestamp]) = TODAY()))

View solution in original post

4 REPLIES 4

Steve
Platinum 4
Platinum 4

Hmmm, the select statement was already in there. I see that I had a bracket in the wrong place and moved it, and now get this error

โ€œErrorsโ€: โ€œError: Workflow rule โ€˜New Reportโ€™ action โ€˜Email Reportโ€™ Body template. Expression โ€˜Select(Enter a Catch[Timestamp]=โ€TODAY()โ€, TRUE)โ€™ is invalid due to: Cannot compare List with Text in (ENTER A CATCH[Timestamp] = โ€œTODAY()โ€). Error: Workflow rule โ€˜New Reportโ€™ action โ€˜Email Reportโ€™ Body template. Start expression โ€˜Select(Enter a Catch[Timestamp]=โ€TODAY()โ€, TRUE)โ€™ 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: Workflow rule โ€˜New Reportโ€™ action โ€˜Email Reportโ€™ Body template. Start expression โ€˜Select(Enter a Catch[Timestamp]=โ€TODAY()โ€, TRUE)โ€™ 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.โ€,

The timestap is the Key column so it should work from what I am thinking. Not sure why itโ€™s not.

Your original expression:

Select(Enter a Catch[Timestamp=TODAY()], TRUE)

is invalid because AppSheet treats everything between the square brackets as a column name, but your column is not named Timestamp=TODAY().

Your revised expression:

Select(Enter a Catch[Timestamp]=โ€TODAY()โ€, TRUE)

is invalid because the first argument is an expression (Enter a Catch[Timestamp]=โ€TODAY()โ€) when it should be just a column specification (e.g., Enter a Catch[Timestamp]). Not strictly invalid, but probably not what you really want: the TODAY() function is in quotes, making it a literal Text value. You probably donโ€™t want to compare a timestamp to the literal text.

What you probably want:

Select(Enter a Catch[Timestamp],[Timestamp]=TODAY())

Or:

FILTER("Enter a Catch", ([Timestamp] = TODAY()))

These suggested SELECT() and FILTER() expressions are equivalent, but I prefer FILTER() because it returns the row keys automatically so you donโ€™t have to specify the key column.

If the Timestamp column is of type DateTime, use DATE([Timestamp]) instead of just [Timestamp] in the above, like this:

FILTER("Enter a Catch", (DATE([Timestamp]) = TODAY()))

Thank you. I have been trying every combination I can think of. Think I need to brush up on my database skills.

Top Labels in this Space