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

Using Date in Crosstab Column Heading in Calculation

1
This is a query I have created that picks up the top 3 dates for this
data (for example) :


Tree Pos2 Date
1 15 23/08/2005
1 20 12/02/2006
1 32 15/10/2006
2 17 23/08/2005
2 18 12/02/2006
2 20 15/10/2006


The top 3 dates are 23/08/2005(date1) ; 12/02/2006(date2) ;
15/10/2006(date3)


Using this data with the dates, I need do a calculation such that it
counts the number of days between date2 and date1 and also date3 and
date2.


Using this : it must do another calculation : noof days/pos2


I've tried using a crosstab query but how do i use the column headings
of the date?
I tried writing a function and using queries but got lost halfway...
but it wasn't taking the pos2 data well - it needed it in a
calculation..


Need help.

I am using Access 2003 ; WindowsXP
Apr 17 '07 #1
1 2617
Rabbit
12,516 Expert Mod 8TB
This is difficult. You're going to have to rank the top 3 dates in one query.

In a second query you'll use DLookups to calculate the difference between the dates and then calculate your other formula.

Or you could use code to do it, in which you'll have to open a recordset and loop through the top 3 records and do your calculations that way.
Apr 20 '07 #2

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

Similar topics

1
by: Annette Massie | last post by:
I would like to have a crosstab of the number of campers by month as row headings and by year as column headings with an additional column of the average. So, in January we had 10 campers for...
3
by: Sean Howard | last post by:
This is a very fustration problem. I have a crosstab query in MS Access that uses a data field (say called "Brand") as the column headings. As I need several crosstab queries to output data in a...
6
by: Gary | last post by:
I have an example table with fields and records as shown below: RECORD_ID DATE PRODUCT QUANTITY 1 4/1/05 widget1 50 2 4/2/05 widget1 48 3 ...
0
by: Kaur | last post by:
Hi, I have created a report based on a cross tab query and would like to Sort the column heading of the report based on the sort order of another field. I have three tables called survey...
2
by: Nenad Markovic | last post by:
Hi everybody, When executing a Crosstab Query I see only rows (defined in a row heading) that have values (defined in value field) in at least one column (defined as column headings). How can...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These averages are compared to their expected productivity....
5
by: billelev | last post by:
I have a cross tab query with Date as a row heading and a series of Names as column headings. The Value for each Date/Name intersection can either be -1, 0 or 1. For example: Date, Name1,...
13
beacon
by: beacon | last post by:
I'm working on creating a dynamic report that is based on a crosstab query. It's similar to the method described at the following link: http://support.microsoft.com/kb/328320 I've tweaked the...
1
by: GLEberts | last post by:
I have a crosstab query for 12 months of sales. It works well except is adds all the months sales together for every year. Does not seperate 2009 from 2008 and so on. It sums all the years...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.