i am running a query like:

Select {[Measures].[Principal Amount]} ON 0,
{[LoansDisbursedDate].[All LoansDisbursedDate].[2004].[January].children,[LoansDisbursedDate].[All LoansDisbursedDate].[2004].[April].children} on 1
from loans


It gives me an error saying " cannot find dimension member " . This error is coming becouse in my fact table there is no data for "April" month.

Basically i want to retieve all the data for the specified months only. 2004 "Jan" month data is present in the fact table but 2004 "April" month data is not present so the MDX query returns an error.

So how to write MDX query in way to avoid such errors.

I am building this query in a web application and passing it to the sql server reporting services report as a parameter so there is no way i can know all the dimension members present in the OLAP server while forming the query in the web application.

Can we use a range in this case to avoid such errors ???

Please reply back ASAP.