Home Forum Contact

 Access World Forums making a discount query based on repeated orders
 Register FAQ Members List Social Groups Top Posters Search Today's Posts

04-17-2018, 05:06 AM   #1
mantas123
Newly Registered User

Join Date: Apr 2018
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
making a discount query based on repeated orders

Hello community, I am trying to make a calculated field that would give me a discount on repeated orders based on multiple I already have done a discount on large orders
here is the statements in my calculated fields:
Order Cost: [Quantity]*[Product Cost]+[fixed Delivery Cost]
Discount: IIf(([Order Cost])>100,([Order Cost])*0.1,0)
Total cost: [Order Cost]-[Discount]

Attached Images
 query.png (54.4 KB, 15 views) query 2.png (8.5 KB, 16 views)

04-17-2018, 10:18 AM   #3
mantas123
Newly Registered User

Join Date: Apr 2018
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: making a discount query based on repeated orders

am not sure I quite understood you there I am trying to add another calculated field which would give a 20% discount if a customer has made multiple orders.
I believe what you have told me is how to tidy up my 3 calculations into one for a discount on a large order

04-17-2018, 11:18 AM   #5
CJ_London
Super Moderator

Join Date: Feb 2013
Location: UK
Posts: 10,472
Thanks: 40
Thanked 3,384 Times in 3,279 Posts
Re: making a discount query based on repeated orders

Quote:
 I am trying to add another calculated field which would give a 20% discount
to be clear, you mean a calculated column in a query? or a calculated control in a form? or a calculated field in a table?

Describe your calculation. Your description refers to a multiple but then not used.

At the moment best I can suggest is using the dcount function

DiscountPC:iif(dcount("*","tblOrders","CustID=" & custID)>3, 0.2, 0)
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button

 04-17-2018, 12:16 PM #6 mantas123 Newly Registered User   Join Date: Apr 2018 Posts: 3 Thanks: 0 Thanked 0 Times in 0 Posts Re: making a discount query based on repeated orders I basically want an if statement that says something like this: if customerID is repeated 2 or more times then discount = 20% there is no timescale or sizes this is not for a real business it is a school project so it doesn't have to be complex

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Access World     Access World News     Site Suggestions     Introduce Yourself     The Watercooler Microsoft Access Discussion     General     Tables     Queries     Forms     Reports     Macros     Modules & VBA     Theory and practice of database design     Access Web Microsoft Access Reference     Access FAQs     Code Repository     Sample Databases     Microsoft Access Tutorials     Microsoft Access User Groups Apps and Windows     SQL Server     Crystal Reports     Visual Basic     VB.NET     Word     Excel     Web Design and Development         ASP and ASP.NET         PHP & MySQL     Windows     Other Software     Hardware Questions and Answers Non-Access Issues     Politics & Current Events     Debates     Gaming     Sports, Health & Fitness     Gadgets     Small Business

 Similar Threads Thread Thread Starter Forum Replies Last Post joe_madeira Queries 7 12-08-2011 11:49 PM MBM Forms 3 04-29-2011 05:35 PM NewShoes Queries 4 08-17-2009 09:19 AM nexus2011 Tables 8 03-22-2007 04:52 AM pmcleod Forms 2 06-10-2005 08:42 AM

All times are GMT -8. The time now is 05:35 AM.

 Microsoft Access Help General Tables Queries Forms Reports Macros Modules & VBA Theory & Practice Access FAQs Code Repository Sample Databases Video Tutorials Featured Forum post Sponsored Links