Dear All,
I am trying to carryout some logical calculation and prefer the easiest way.
I have form where i need to calculate two dates fields based on my calendar_table data let me tell you more and deep about it .
Fields for Form is
[StartDate] - Date Field text box
[EndDate] - Date Field text box
[Nett] this is the text box where i want the result.
Fields for Calendar_table is
[CalendarDate] - Date field where all dates from 1991 to 2040 is mentioned date by date.
[NWD] - Number or calculated field
Now i need startdate and endDate of form selection should calculate total of that particular period from Calendar_table for [NWD]
for example
form's [StartDate] is 01 Sep 2015 and [EndDate] is 05 Sep 2015 and
Calendar_table's [CalandarDate] rows mentioned values for above dates is
01 Sep 2015 is 1
02 Sep 2015 is 0
03 Sep 2015 is 2
04 Sep 2015 is 1
05 Sep 2015 is 0
than result on Form's [Nett] should be 4 if not selected any date in form's start or end date than should appear zero in nett field on form.
in order to achieve that i try with following expression on [Nett] field but not succeeded.
=Sum(IIf([StartDate]=[Calendar_table]![CalendarDate] AND [EndDate]=[Calendar_table]![CalendarDate],[Calendar_table]![NWD]))
Can anyone help me with above, if required any VBA coding in easiest way that can be great also.
MA
I am trying to carryout some logical calculation and prefer the easiest way.
I have form where i need to calculate two dates fields based on my calendar_table data let me tell you more and deep about it .
Fields for Form is
[StartDate] - Date Field text box
[EndDate] - Date Field text box
[Nett] this is the text box where i want the result.
Fields for Calendar_table is
[CalendarDate] - Date field where all dates from 1991 to 2040 is mentioned date by date.
[NWD] - Number or calculated field
Now i need startdate and endDate of form selection should calculate total of that particular period from Calendar_table for [NWD]
for example
form's [StartDate] is 01 Sep 2015 and [EndDate] is 05 Sep 2015 and
Calendar_table's [CalandarDate] rows mentioned values for above dates is
01 Sep 2015 is 1
02 Sep 2015 is 0
03 Sep 2015 is 2
04 Sep 2015 is 1
05 Sep 2015 is 0
than result on Form's [Nett] should be 4 if not selected any date in form's start or end date than should appear zero in nett field on form.
in order to achieve that i try with following expression on [Nett] field but not succeeded.
=Sum(IIf([StartDate]=[Calendar_table]![CalendarDate] AND [EndDate]=[Calendar_table]![CalendarDate],[Calendar_table]![NWD]))
Can anyone help me with above, if required any VBA coding in easiest way that can be great also.
MA