Calucation in query

  • Thread starter http://www.microsoft.com/windowsxp/downloads/updat
  • Start date
H

http://www.microsoft.com/windowsxp/downloads/updat

I am trying to write a statement saying : If the DueDate is greater than
today, then give me a past due amount by calculating ($25.00 +FeeDue -
AmtPaid. Otherwise leave blank.

This is what I have written and it won't work.

IIf("«Expr» [DueDate]">Date(),Sum(25)+[FeeDue]-[AmtPaid]," ")

I added a new field in the query and put this code in the Criteria area.
I'm am still very green in this and any help is appreciated.
 
R

ruralguy via AccessMonster.com

Try:
IIf([DueDate]<Date(),25.00+[FeeDue]-[AmtPaid]," ")


http://www.microsoft.com/windowsxp/downloads/updates/moviemaker2.mspx said:
I am trying to write a statement saying : If the DueDate is greater than
today, then give me a past due amount by calculating ($25.00 +FeeDue -
AmtPaid. Otherwise leave blank.

This is what I have written and it won't work.

IIf("«Expr» [DueDate]">Date(),Sum(25)+[FeeDue]-[AmtPaid]," ")

I added a new field in the query and put this code in the Criteria area.
I'm am still very green in this and any help is appreciated.
 
H

Hank

Am I putting the code in the right place?
I don't get an error with your code - thanks. But I still don't get the
past due amount in the query.

ruralguy via AccessMonster.com said:
Try:
IIf([DueDate]<Date(),25.00+[FeeDue]-[AmtPaid]," ")


http://www.microsoft.com/windowsxp/downloads/updates/moviemaker2.mspx
wrote:
I am trying to write a statement saying : If the DueDate is greater than
today, then give me a past due amount by calculating ($25.00 +FeeDue -
AmtPaid. Otherwise leave blank.

This is what I have written and it won't work.

IIf("«Expr» [DueDate]">Date(),Sum(25)+[FeeDue]-[AmtPaid]," ")

I added a new field in the query and put this code in the Criteria area.
I'm am still very green in this and any help is appreciated.
 
R

ruralguy via AccessMonster.com

You are going to want this in the top line of the query field. The one
labeled Field:

NewFieldName: IIf([DueDate]<Date(),25.00+[FeeDue]-[AmtPaid]," ")

...using *your* NewFieldName of course.
Am I putting the code in the right place?
I don't get an error with your code - thanks. But I still don't get the
past due amount in the query.
Try:
IIf([DueDate]<Date(),25.00+[FeeDue]-[AmtPaid]," ")
[quoted text clipped - 11 lines]
 
H

Hank

Thanks for getting me on the right track. Now it works great except - How
do I fomat the results as currency? The results I get looks like a text
field (i.e. 10 and not $10.00). In the properties window of this field
under format, there are no options - the drop down box is empty. I tried
typing 'currency' but that did not work.

ruralguy via AccessMonster.com said:
You are going to want this in the top line of the query field. The one
labeled Field:

NewFieldName: IIf([DueDate]<Date(),25.00+[FeeDue]-[AmtPaid]," ")

..using *your* NewFieldName of course.
Am I putting the code in the right place?
I don't get an error with your code - thanks. But I still don't get the
past due amount in the query.
Try:
IIf([DueDate]<Date(),25.00+[FeeDue]-[AmtPaid]," ")
[quoted text clipped - 11 lines]
I added a new field in the query and put this code in the Criteria area.
I'm am still very green in this and any help is appreciated.
 
R

ruralguy via AccessMonster.com

NewFieldName: IIf([DueDate]<Date(),Format(25.00+[FeeDue]-[AmtPaid],"currency")
," ")

Thanks for getting me on the right track. Now it works great except - How
do I fomat the results as currency? The results I get looks like a text
field (i.e. 10 and not $10.00). In the properties window of this field
under format, there are no options - the drop down box is empty. I tried
typing 'currency' but that did not work.
You are going to want this in the top line of the query field. The one
labeled Field:
[quoted text clipped - 12 lines]
 
H

Hank

Thanks again, Works great now
Hank
ruralguy via AccessMonster.com said:
NewFieldName:
IIf([DueDate]<Date(),Format(25.00+[FeeDue]-[AmtPaid],"currency")
," ")

Thanks for getting me on the right track. Now it works great except -
How
do I fomat the results as currency? The results I get looks like a text
field (i.e. 10 and not $10.00). In the properties window of this field
under format, there are no options - the drop down box is empty. I tried
typing 'currency' but that did not work.
You are going to want this in the top line of the query field. The one
labeled Field:
[quoted text clipped - 12 lines]
I added a new field in the query and put this code in the Criteria
area.
I'm am still very green in this and any help is appreciated.
 

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

Similar Threads


Top