View Single Post
  #10  
Old May 30th, 2010, 05:26 PM posted to microsoft.public.access.queries
Dennis
external usenet poster
 
Posts: 1,222
Default Very difficult query (?)

Leslie,

You might want to take a look at the cross tab query. I've never used it,
but I think it does what you are trying to do here.

Good luck.


--
Dennis


"Leslie Isaacs" wrote:

Hello Dennis

Very many thanks for your persistence with this. In answer to your
questions:

There will never be more than 3 'cont rate' values for any 'employeename'.
Var1 should represent the earliest 'cont rate' value, and Var2 should
represent the latest 'cont rate' value (unless there is only one 'cont rate'
value, in which case the Var1 columns must be null/blank).
I should also add that the query will ultimately be used with an OutputTo
macro command, so that an excel spreadsheet of the results can be emailed
out. It's this excel spreadsheet that MUST be in a pre-defined format -
which is what's dictating the output of the query. In view of this, I don't
think a cross-tab query would work.

I think your suggested "other approach" is very similar to what I had been
trying, so it's reassuring to know that I'm probably on the right lines
(because I'd seriousdly begun to doubt it!).

I'll therefore carry on, and get back to you all here if I get completely
stuck.

Many thanks again
Les


"Dennis" wrote in message
...

Leslie,

One other approach might to be create five queries that generate each
piece
of the line

1. One that groups by all of the data as described above.
2. One that reads the temp table and creates a table with the first three
columns.
3. One that reads the temp table and creates a table for the 2nd column
set
4. One that reads the temp table and creates a table for the last columns

A fifth would join the last three tables into one, resulting in one line
per
employee with all of the data on it.

Dennis



.