I have a table with a frequency (the value at which something will happen), frequnit (units at which it will happen), nextdate1 (next time we expect it to happen).
FREQUENCY FREQUNIT NEXTDATE1 nextdate2
2 MONTHS 1/2/2015
3 WEEKS 10/5/2015
30 DAYS 2/1/2015
1 YEARS 3/1/2015
I need to get the nextdate2 by multiplying the frequency and by the date.
Continue the same for nextdate3 and so on.
I can do this in Excel by using this formula...
=IF($AI20=0,"",IF($Q20="YEARS",DATE(YEAR(AK20)+($P20),MONTH(AK20),DAY(AK20)),IF($Q20="MONTHS",DATE(YEAR(AK20),MONTH(AK20)+($P20),DAY(AK20)),IF($Q20="WEEKS",DATE(YEAR(AK20),MONTH(AK20),DAY(AK20)+7*($P20)),IF($Q20="DAYS",DATE(YEAR(AK20),MONTH(AK20),DAY(AK20)+1*($P20)))))))
===================================
AK20= NEXTDATE1
Q20= FREQUNIT
P20= FREQUENCY
===================================
I would like to convert it to access and for cast it out for 12 months.
I tried to convert, but i keep getting errors.
NextDate2:
=IIF([FREQUNIT]='YEARS',YEAR([NEXTDATE1])+[FREQUENCY],MONTH([NEXTDATE1]),DAY([NEXTDATE1])),IIF([FREQUNIT]="MONTHS",YEAR([NEXTDATE1]),MONTH([NEXTDATE1])+([FREQUENCY]),DAY([NEXTDATE1])),IIF([FREQUNIT]="WEEKS",YEAR([NEXTDATE1]),MONTH([NEXTDATE1]),DAY([NEXTDATE1])+7*([FREQUENCY])),IIF([FREQUNIT]="DAYS",DATE(YEAR([NEXTDATE1]),MONTH([NEXTDATE1]),DAY([NEXTDATE1])+1*([FREQUENCY])))
Any help would be appreciated.
Thanks
tav
FREQUENCY FREQUNIT NEXTDATE1 nextdate2
2 MONTHS 1/2/2015
3 WEEKS 10/5/2015
30 DAYS 2/1/2015
1 YEARS 3/1/2015
I need to get the nextdate2 by multiplying the frequency and by the date.
Continue the same for nextdate3 and so on.
I can do this in Excel by using this formula...
=IF($AI20=0,"",IF($Q20="YEARS",DATE(YEAR(AK20)+($P20),MONTH(AK20),DAY(AK20)),IF($Q20="MONTHS",DATE(YEAR(AK20),MONTH(AK20)+($P20),DAY(AK20)),IF($Q20="WEEKS",DATE(YEAR(AK20),MONTH(AK20),DAY(AK20)+7*($P20)),IF($Q20="DAYS",DATE(YEAR(AK20),MONTH(AK20),DAY(AK20)+1*($P20)))))))
===================================
AK20= NEXTDATE1
Q20= FREQUNIT
P20= FREQUENCY
===================================
I would like to convert it to access and for cast it out for 12 months.
I tried to convert, but i keep getting errors.
NextDate2:
=IIF([FREQUNIT]='YEARS',YEAR([NEXTDATE1])+[FREQUENCY],MONTH([NEXTDATE1]),DAY([NEXTDATE1])),IIF([FREQUNIT]="MONTHS",YEAR([NEXTDATE1]),MONTH([NEXTDATE1])+([FREQUENCY]),DAY([NEXTDATE1])),IIF([FREQUNIT]="WEEKS",YEAR([NEXTDATE1]),MONTH([NEXTDATE1]),DAY([NEXTDATE1])+7*([FREQUENCY])),IIF([FREQUNIT]="DAYS",DATE(YEAR([NEXTDATE1]),MONTH([NEXTDATE1]),DAY([NEXTDATE1])+1*([FREQUENCY])))
Any help would be appreciated.
Thanks
tav