I’ve an Access query as shown below & I want to generate the yellow highlighted fields
Description:
For ItemID there are group(s) and a single duration, for each group there are days before and days after.
The target (3 conditions):
1- If a group elements has full duration i.e. (Full_Dur) flag is Yes for both, the required 2 fields (D_before_G & D_after_G) shall be same as D_before & D_after as in group “2”.
2-If a group elements has one full duration & the other is less the duration i.e. one (Full_Dur) flag is Yes & the second is No, the required 2 fields (D_before_G & D_after_G) shall be same as D_before & D_after with flag “No” as in group “1” ItemID “2010”.
3- If a group elements has less than full duration i.e. (Full_Dur) flag is No for both, the required 2 fields (D_before_G & D_after_G) shall be same as lowest D_before & the lowest D_after.
Note: Groups elements are only 2 numbers & also not repeated within an “ItemID”