Hello,
I’d like to repeat the last not = 0 record under certain conditions, in a table or in a query.
What I have:
Calendar_All Dates
Calendar date MyValue
7/6/2014 0.00
7/7/2014 108.94
7/8/2014 107.71
7/9/2014 107.07
7/10/2014 105.89
7/11/2014 105.30
7/12/2014 0.00
7/13/2014 0.00
7/14/2014 104.69
7/15/2014 0.00
7/16/2014 0.00
7/17/2014 0.00
7/18/2014 0.00
7/19/2014 0.00
7/20/2014 0.00
7/21/2014 0.00
7/22/2014 0.00
7/23/2014 0.00
What I want:
Calendar_All Dates
Calendar date MyValue
7/6/2014 0.00
7/7/2014 108.94
7/8/2014 107.71
7/9/2014 107.07
7/10/2014 105.89
7/11/2014 105.30
7/12/2014 0.00
7/13/2014 0.00
7/14/2014 104.69
7/15/2014 104.69
7/16/2014 104.69
7/17/2014 104.69
7/18/2014 104.69
7/19/2014 0.00
7/20/2014 0.00
7/21/2014 104.69
7/22/2014 104.69
7/23/2014 104.69
Basically, if Calendar date > Date(), if Calendar Date not Saturday or Sunday, weekday(Calendar date<>1 and <>7), AND Calendar Date not in (Holidays table)
Then repeat the last not = 0 value of MyValue
The idea is clear but I can’t find the right way to write it.. I thought of changing the default value but the value is already 0, while default is null + I need to set the default value under certain conditions.
Thanks a lot for your help!
[FONT="]Ben[/FONT]
I’d like to repeat the last not = 0 record under certain conditions, in a table or in a query.
What I have:
Calendar_All Dates
Calendar date MyValue
7/6/2014 0.00
7/7/2014 108.94
7/8/2014 107.71
7/9/2014 107.07
7/10/2014 105.89
7/11/2014 105.30
7/12/2014 0.00
7/13/2014 0.00
7/14/2014 104.69
7/15/2014 0.00
7/16/2014 0.00
7/17/2014 0.00
7/18/2014 0.00
7/19/2014 0.00
7/20/2014 0.00
7/21/2014 0.00
7/22/2014 0.00
7/23/2014 0.00
What I want:
Calendar_All Dates
Calendar date MyValue
7/6/2014 0.00
7/7/2014 108.94
7/8/2014 107.71
7/9/2014 107.07
7/10/2014 105.89
7/11/2014 105.30
7/12/2014 0.00
7/13/2014 0.00
7/14/2014 104.69
7/15/2014 104.69
7/16/2014 104.69
7/17/2014 104.69
7/18/2014 104.69
7/19/2014 0.00
7/20/2014 0.00
7/21/2014 104.69
7/22/2014 104.69
7/23/2014 104.69
Basically, if Calendar date > Date(), if Calendar Date not Saturday or Sunday, weekday(Calendar date<>1 and <>7), AND Calendar Date not in (Holidays table)
Then repeat the last not = 0 value of MyValue
The idea is clear but I can’t find the right way to write it.. I thought of changing the default value but the value is already 0, while default is null + I need to set the default value under certain conditions.
Thanks a lot for your help!
[FONT="]Ben[/FONT]