If this is true expression for a report

I have a table - Collection Event and a table - Disposal Event. Each collection event is eventually assigned a Disposal Event.

Report is based on the Collection Event table.

I need an expression in the โ€œIf This is Trueโ€ dialogue box of the Collection Event table that fires the report if Column [Timestamp] column type Date in the associated Disposal Event table is equal to today().

Iโ€™ve tried a range of expressions and no luck. Many thanks to anyone who can help. Stay safe.

0 10 287
10 REPLIES 10

Are these 2 tables connected to each other somehow? Is there a reference between them?

Yes. In the Collection Event able the user selects the appropriate disposal event. When viewing the Disposal Events the related collection events are listed. I hope that helps.

So you can easily create a LOOKUP() expression:

TODAY() = LOOKUP([_THISROW].[CollectionID],"Disposal Event","RefColumnName","Timestamp")

@LeventK Thank you. So the โ€œRefColumnNameโ€ is [Disposal Event]. This is the column in the Collection Event table that is used to assign/ link it to the disposal event. When I use the expression TODAY() = LOOKUP([_THISROW].[CollectionID],โ€œDisposal Eventโ€,โ€œDisposal Eventโ€,โ€œTimestampโ€) I get the message that it cannot find column โ€œDisposal Eventโ€.

Whatโ€™s your table name? LOOKUP() expression should take below parameters:
LOOKUP(Search string, TableName, LookupColumnName, ReturnColumnName)

@LeventK The table names are Collection Event and Disposal Event

Disposal Event has a related collection event.

@Scott_Hall
I have no any idea about your table schema and column names. I have given the LOOKUP structure above, so you can adjust the expression as per your table schema and column names I believe.

@LeventK Thank you. Iโ€™ve used this expression below. But am wondering if it will work since the [Timestamp] column in the Collection Event table is type DateTime. It does come up as a valid expression. This is for the โ€œif this is trueโ€ dialogue box for table Disposal Event.

Today() = LOOKUP(Today(), โ€œDisposal Eventโ€, โ€œTimestampโ€, โ€œTimestampโ€)

(TODAY()) is equal to (One randomly chosen value from this list (
โ€ฆThe list of values of column โ€˜Timestampโ€™
โ€ฆfrom rows of table โ€˜Disposal Eventโ€™
โ€ฆwhere this condition is true: ((The value of column โ€˜Timestampโ€™) is equal to (TODAY()))))

Have you tested it? Beyond the syntax check done by Expression Assistant? Testing is a good way to find out if it works or not.

@Steve Thanks Steve. Wasnโ€™t very familiar with the testing feature but found it and will do.

Top Labels in this Space