Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

expression forumula help

Forum home » Delegate support and help forum » Microsoft Access Training and help » Expression Forumula Help

Expression Forumula Help

ResolvedVersion 2003

Clair has attended:
Access Advanced course
Access VBA course
Excel VBA Intro Intermediate course

Expression Forumula Help

Hi

I'm pulling my head out, and I know its probably really simple, but how do I do an if Statement in Access 2003, please?

I just can't get it right:

ListingFee: =IIf([Relisted]>1),[Relisted]*0, [Relisted]*1.2

What is its, "listed" is the number of days between since item was listed and the day it sold, and they only pay listing fee, if it was on there for longer than a week so a listing fee per week, but not for the first week).

What I wanted to ask it was, if "Relisted", is less than 1, then result is times zero, but it its higher than 1, multiply by 1.20

Hope that makes sense, hope someone can help?

thanks so much

Clair

RE: Expression Forumula Help

Hi Clair, thanks for your query. First of all I'm going to assume you copied that formula correctly onto the forum; if so you need to watch what's happening to your brackets. Secondly, if you multiply anything by zero...you'll get zero! Thirdly, watch your mathematical operators and the order of the arguments in the expression; at the moment in your formula you get zero only when Relisted is greater than one, if it's less than one it multiplies by 1.2 which is the wrong way round. You haven't given me the field names to produce the final formula exactly (Listed and Relisted? Are these two separate fields? Is the listing fee in a field itself?) but it's going to be something like:

MyNewListingFee: =IIF([Listed]>7, [ListingFee]*1.2, [ListingFee])

Hope this helps,

Anthony

RE: Expression Forumula Help

Thank you Anthony

Yes I copied that out of a forum, and can't get it to do what I need.

What I'm trying to do, is work out how long the item has been listed for?

They get a charge for each week the item is relisted, up to 3 weeks (then the item is returned if unsold).

But the calculation field I have, is in days.

So I want to see if its less than 7 days, its zero, but if its 7, 14 or 21, they get a fee (£1.20) of 1.20, 2.40 or 3.60.

Also, I am going to need to be able to select items to be invoiced (where they calculations fields will be picked up and form an invoice), I'm not quite sure how to do that?

Can I store the invoices per customer, so if a customer comes in, they can show them what they've been paid for, when, what invoice number, and I can show them which items are outstanding (not been invoiced for yet)

I do want to pull VBA in, but want to get the nuts and bolts working first.

Thanks so much
Clair

Fri 2 Mar 2012: Automatically marked as resolved.

Access tip:

How To Find All Overdue Accounts?

To find overdue accounts create a filter that compares today's date with the Invoice Date in the table. To do this:

1. Open the Query in Design View
2. Select the field for the filter and in the criteria row enter:

<Date()

This filter returns records where the Invoice Date is before today's date.

This filter can be manipulated if, for instance, Invoices are due 15 days after the Invoice Date. For this the filter would be:

<Date()-15

This filter returns records where the Invoice Date is 15 days before today's date.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.