Point in time on triggers - select next available time
I have been trying to figure out how to solve point in time within triggers in my QV application for quite a while now.
I have got triggers set on opening my application. These are set to pick the 8am snapshot. This approach was working fine until our DW went out of sync and snapshot was instead of 8am created at 9am.
Now I would like to find a solution in case this happens again in the future. So if the snapshot at 8am is not created, then pick the 9am one. If the 8am is not created, but instead the snapshot is created at 10am pick this one...and so on.
I have tested the following solutions within my app where data 8am snapshot exists, and I have also tested these within my app_test where the 8am snapshot does not exist but the 9am snapshot exists.
1. Works fine where 8 am snapshot exist. Doesn't work for 9am snapshot exists, but 8am snapshot doesn't.