473,434 Members | 1,462 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,434 software developers and data experts.

Query calculations when some records don't exist

doma23
107 100+
Would it be possible later to do query calculations between two records even when one of the two records doesn't exist?

Example:

COMPANY____PERIOD___SALES

Company1___1H2012___125
Company1___1H2011___100
*Company1___1H2010____? (*this record doesn't exist at all)

Company2___1H2012___240
Company2___1H2011___220
Company2___1H2010___200


So I want to compare these records, to see the percentage increase in Sales over three periods, for each company.

I want to get something like this, period vs period comparison:

COMPANY____1H2011___1H2012
Company1___ n/a ____ 25%
Company2___ 10% ____ 20%
Nov 9 '11 #1

✓ answered by Rabbit

You would do an aggregate query and pivot on the period. The missing value will be blank.

2 1563
Rabbit
12,516 Expert Mod 8TB
You would do an aggregate query and pivot on the period. The missing value will be blank.
Nov 9 '11 #2
doma23
107 100+
How would I set up then the formula to show the percentage changes in the crosstab query (I suppose that's what you mean by pivot)?
There would only be one field in which I must write formula, and that's Period (which would be shown as column), what do I write to compare different periods?

Query view:



Result:



Edit: SOLVED
I solved it by making another query and bringing Crosstab query to it, which then showed periods "1H11" and "1Q11" as Fields.
It was quite simple after that.
Nov 9 '11 #3

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

Similar topics

4
by: jdn | last post by:
Driving me nuts. Web page calls a function in a different class library that is to return a string. Inside this function, I create a string, give it a value, then try to do a string.replace....
4
by: Diarmaid | last post by:
Hi! I've built a dynamic navigation system which compares the filename in the document URL with the filename in the navigation link in order to determine which link to highlight as "active". ...
2
by: rivka.howley | last post by:
I wrote some code that creates a table with a date/time field at 15-minute intervals. Here's how I create and populate the table With tblDataTemp ..Fields.Append .CreateField("CT_ID", dbLong)...
1
by: Tom W | last post by:
hi I've found some code for playing sounds and it kinda works. This is what I have \\\\\Public Class SoundClas Declare Auto Function PlaySound Lib "winmm.dll" (ByVal name As String, ByVal hmod As...
6
by: Erik Johnson | last post by:
Maybe I just don't know the right special function, but what I am wanting to do is write something akin to a __getattr__ function so that when you try to call an object method that doesn't exist,...
2
by: Pascal | last post by:
bonjour/hello I have an application with several forms : form1 is loaded at first. Man makes some staff (filling text box, clicking radiobutton) in this window and then click nextbutton and so on...
4
by: M Bourgon | last post by:
I have two SPs, call them Daily and Weekly. Weekly will always call Daily, but Daily can run on its own. I currently use a global temp table because certain things I do with it won't work with a...
2
by: kilo | last post by:
Hey.. I need someone hwo can help me making my sql table.. I have no php skills. I have payed for a php program that shoud make dictation for people that have some problems reading danish.. with...
3
by: cheesecaker | last post by:
For some reason, when PHP starts, it doesn't want to load some extensions that I KNOW are there. Here's the startup log: Parent: Received restart signal -- Restarting the server. Child 5176:...
1
by: Jason7899 | last post by:
hi, i have this domain for example: mydomain.com and i want when i enter this url in browser: mydomain.com/test the htacess see the "test" redirect the site for test location and to that for...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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?

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.