The best way to do this my opinion is to break each section down and test your expression with each section and then combine it.
=iif(code = val1 and date1>parameter_start_date and date1<parameter_end_date and flag = "D", field!charge.value,
iif(date2>parameter_start_date and date2<parameter_end_date and flag = "D", field!charge.value,0))
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.