Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textbox calculation problem

Status
Not open for further replies.

mjd3000

Programmer
Apr 11, 2009
136
GB
I have the following data :

Month Target Actual IsLastCompletedMonth
1 10 5 No
2 15 3 No
3 12 7 No
4 8 4 Yes
5 10 0 No
6 12 0 No

I need some way of identifying the last completed month in my calculations in a text box on the report. I have tried the following but it only tells me if the first record is the last completed month.

=IIF(Fields!IsLastCompletedMonth.Value = "Yes", Fields!Month.Value, "No Month Completed")

Can anybody help?
 
By far your easiest solution will be to add a new DataSet and query to get that value from your database. For example:

SELECT MAX(Month) FROM SomeTable WHERE IsLastCompletedMonth = 'Yes'

You can then use the FIRST field value of that new DataSet in your TextBox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top