using a vairable in expression builder

S

S Green

Hi I am wondering if someone could please advise me on the following:

Below are two examples of iif statements driving two of many fields in a rec
query I have created. You will note the dates for the period are hard coded.
I would like to have the date as a variable which is prompted for when the
query is run, rather than having to hard code it in expression builder.

CurrentPeriod:
IIf([Data]![Source]="Source1",IIf([Data]![ReportingDate]=#31/03/2008#,[Data]![Amount],"0"),"0")

PriorPeriod:
IIf([Data]![Source]="Source1",IIf([Data]![ReportingDate]=#29/02/2008#,[Data]![Amount],"0"),"0")

I would really appreciate any advise people can provide to me around this.

Many Thanks
 
D

Dennis

CurrentPeriod:
IIf([Data]![Source]="Source1",IIf([Data]![ReportingDate]=CDate([Enter Date
dd/mm/yyyy]),[Data]![Amount],"0"),"0")

PriorPeriod:
IIf([Data]![Source]="Source1",IIf([Data]![ReportingDate]=CDate([Enter Date
dd/mm/yyyy]),[Data]![Amount],"0"),"0")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top