473,473 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Max of Two Numbers in SQL - What function is available?

1 New Member
I am trying to figure out a way to find the max of two numbers in access, and then multiply whatever the max is by 0.008.
For example:
2019 Sales - $9,634.33
2020 Sales - $3,466.37
Find the max of the two and multiply by 0.008.

Hopefully I am explaining this well. The 2019 and 2020 sales differ for each company, so not everyone's 2020 sales will be greater than their 2019 and vice versa.
Dec 22 '20 #1
1 1726
NeoPa
32,556 Recognized Expert Moderator MVP
Hi there.

Are you calculating this from within a query or from VBA?

Either way you can use the IIf() function but illustrating it changes based on your usage.

Query (SQL) :
Expand|Select|Wrap|Line Numbers
  1. IIf([2019 Sales]>[2020 Sales],[2019 Sales],[2020 Sales])*0.008
VBA :
Expand|Select|Wrap|Line Numbers
  1. X = IIf(dbl2019Sales > dbl2020Sales, dbl2019Sales, dbl2020Sales)*0.008
Dec 22 '20 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Rowan Chapman | last post by:
Hey all! I'm kinda new to VB but not to programin'. So I know what it is like when you are asked trivial questions. Could some1 please tell me what the syntax would be 2 only allow numerical data...
10
by: Ken VdB | last post by:
Hi everyone, Is there a reason why the Mid() function only works in one direction in VBScript? This code works in VB6 but not in VBScript? Is there a way around it? I am trying to create an...
1
by: Yannick Warnier | last post by:
Hi there, I'd like to know since what version the md5() function is available in postgresql. I didn't find the function in the doc (I tried looking at some of the different function types in the...
0
by: Raymond L. Buvel | last post by:
Due to the contribution of Frank Palazzolo, a Windows binary installer and build instructions are available for the clnum package. This also makes ratfun and rpncalc usable on the Windows platform....
7
by: Greg | last post by:
Visual Studio - Line numbers missing from error list I'm writing an app in ASP.NET using VS 2005. There are no line numbers with the build errors reported. Any suggestions? I can't find any...
14
by: nishit.gupta | last post by:
Is their any single fuction available in C++ that can determine that a string contains a numeric value. The value cabn be in hex, int, float. i.e. "1256" , "123.566" , "0xffff" , It can also...
7
by: Anz | last post by:
Can any one know the javascript function to auto resize the swf when resizing its pop up window. I need to auto resize the swf when i resize my popup window in which the swf is displayed. Is...
5
by: Jock | last post by:
My purchase order system sequentially added the next number to the new order when I clicked the macro button set up with copy/paste functions and it worked well. I cannot do this now as 2007 does...
1
by: kalees waran | last post by:
is it possible function available to use multiple headers in a page
2
by: mvjohn100 | last post by:
Does anyone know if there is a UUDecode function available to JavaScript john
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.