473,387 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Calculations in access queries

Hello everybody,

I am calculating NAV (net asset value) of portfolio with access and I am interested if it is possible to do some calculations. Here is example:

In one column I have the value of portfolio, e.g.

Value
99999
88888
77777
88888
66666
99999

I need the other column with would be like this:
Value| Unit Value
99999| 1000
88888| 888
77777| 777
88888| 888
66666| 666
99999| 999

So, first value IS ALWAYS 1000. The second value of the column depends on the change of the first column, e.g.
(88888-99999)/99999 = -11,1 %, so
1000 - 11,1 % = 888 %

Is it possible to do that?

Thank You for answers.
Mar 9 '11 #1
1 1111
Stewart Ross
2,545 Expert Mod 2GB
Relational databases do not work like Excel; relational tables have no inherent concept of position, which is a logical imposition on the set of data stored in the table dependent on the combination of fields you may choose to sort the underlying set. The set of data has not actually changed by sorting the rows in a different order, yet sorting in a different order would invalidate what you are trying to achieve.

Excel uses explicit row referencing of the row previous from the current row to achieve the incremental calculations you are suggesting. There is no simple analogue to this in a relational database.

In essence you will need to join the table back to itself using a ranking structure of some kind, or by date, such that the previous record is joined to the current to allow this kind of calculation. It is neither simple nor straightforward to achieve.

You would need to provide us with fuller details of your table structure, and in particular the key fields which would allow for a ranked approach to be taken in SQL.

-Stewart
Mar 9 '11 #2

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

Similar topics

10
by: Marco Alting | last post by:
Hi, I'm still confused about my queries, I want to do something is ASP that is easily done in Access. I'll post the Access queries below as a reference. The main idea is that the queries depend...
7
by: Dana Shields | last post by:
I am attempting to upsize from access to SQL Server. I'm trying to convert my queries to SQL Server views; however, I'm having a lot of difficulty with the syntax differences. For instance, a...
1
by: Craig Washington | last post by:
How in code can you use the Microsoft Access Queries with ADO in code? Anyone???
1
by: Turloch O'Tierney | last post by:
Greetings, I am migrating Access queries, is there a book that people recommend, ideally with close to EBNF (concise) SQL Query description Is the 'Access 2003 Bible' a good choice, or should...
3
by: Kevin Forbes | last post by:
So, I've found how to list all the tables in an Access database (as seen below) and running MS Access queries is easy (similar to executing a stored procedure), but how do I list the names of all...
6
by: jfbevilaqua | last post by:
Does anyone know of a utility or a method (VBA or otherwise) to be able to export ALL 100+ MS Access Queries from an Access Table into individual text files perhaps ending with .sql so they can be...
4
MMcCarthy
by: MMcCarthy | last post by:
To view Access queries in SQL rather than Access query design - open the query design window and change the view to SQL: Select Statement SELECT FROM ; Append Statement INSERT INTO (, , )...
2
by: MyEmailList | last post by:
We have an Access data base with severl tables, queries and forms. We want to put it on the web. Is there a tool that will convert the Access queries and forms to ASP? Sorta like "splitting"...
5
by: forrestgump | last post by:
I want to be able to run multiple access queries on a single microsoft excel worksheet. Ideally I want to define what queries i want in excel and import the results of all queries one after...
3
by: Shiny Star | last post by:
I have 4tables & I write class for all those table to hold a tables information as one whole unit. I am using MS Access queries, just like stored procedures so the queries (select, update, delete,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.