View Single Post
 
Old 09-26-2020, 06:00 PM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

Then you need to create your own fnLastReg function.
The diagnostic file I sent you contains that function in the making.
If you look at the code of that query you'll see I commented out the first line:
(tbl)=>
and changed the source to:

Source = #"RegsNotRenewedThis Year"
instead of:
Source = tbl


Before you do anything else though, you should note that the source for this query is #"RegsNotRenewedThis Year" which is the same as the one in the non-diagnostic file but with all the steps from and including the Invoked custom function step to the end deleted and one of the words 'Table' clicked upon in the grp column to expand/drill down to that one table, to use as an example for fnLastReg to work on. It's probably best to duplicate the RegsNotRenewedThis Year query and work on that.

When you refresh the preview of fnLastReg you should see all the steps (because it's not a function anymore) and be able to edit what it does more easily.
When fnLastReg gives the results you want, you'll have to make fnLastReg back into a function by reversing the changes made to it above.

Go back to your original RegsNotRenewedThis Year to test it.
Reply With Quote