English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Ok I'm designing a system and need an IIF statement in a query. Basically, I want to give a 10% discount with an order over £10 and need an IIF statement to multiply the order cost by 0.1 (10%) if order is £10 or over. Anyone know what to do? thanks!

2007-02-26 23:21:14 · 3 answers · asked by rock_angel3005 2 in Computers & Internet Software

3 answers

iif ([order_value] > 10, discount = [order_value] * .1 , discount = 0)

...should do the trick, but its not tested

although you should use something like

iif ([order_value]>discount_threshold,discount=[order_value]*discount_rate,discount=0)


where you set discount_threshold and discount rate to soem values probably via a table so that as time marches on you cna quickly and realiably change your values without having to touch the code.

2007-02-26 23:29:28 · answer #1 · answered by Mark J 7 · 0 0

get entry to is a database application (small scale whilst in comparison with the likes sq. Server/Oracle) and Excel is spreadsheet application. The confusion in many circumstances arises because of fact the two have spreadsheet like records get entry to displays. a million) get entry to shops records in tables which would be related to one yet another (relational database) collectively as Excel makes use of flat spreadsheets 2) get entry to like different database apps can use the sq. language to question yet excel has none 3) get entry to can keep lots greater records than excel can wish that helps somewhat? all the suited on your attempt!

2016-11-26 01:45:33 · answer #2 · answered by ? 4 · 0 0

iif(condition, on success, on failure)

2007-02-26 23:39:14 · answer #3 · answered by gansatanswers 3 · 0 0

fedest.com, questions and answers