A
arno
Hello,
I have a table with 255 fields. I would like to use a grouped query with all
255 fields in the result but this does not work.
Before I show what I already did, I would like to describe the problem
behind:
I have a table with many invoices to one project (an I have many projects).
I know which invoices is the last one. Now, I would like to make a query
that gives me only the last invoices of each project. My field names are:
Project=nr, highest number in last Invoice=KDSTichtag.
I need:
- all 255 fields
- the field names must be the same as in the original table
- I have to show all data of only the record that has the maximum value in
KDSTichtag
I think that a simple grouped query will not do the job. This is where I am
stuck:
The query looks like this
SELECT last(STICHTAG) as Stichtag, max(KDStichtag) as KDStichtag,
last(s_typ) as s_typ, nr, last(mc) as mc, .....etc....
FROM s_ProjektCo
GROUP BY nr ;
Now I have 2 problems:
1) From Excel using ADO
I get the error "Error -2147467259 Too many fields defined. (Source:
Microsoft JET Database Engine) (SQL State: 3190) (NativeError: -68092944)"
The fields are named correctly, however, I can have only 254 fields!
2) Access Query
In Access I get an error (translated): "Alias 'Stichtag' caused a circular
reference in the SELECT-List of the query definition."
To make the query run, I have to use different aliases AND I must delete one
field so that I query only 254 fields.
Best regards
arno
I have a table with 255 fields. I would like to use a grouped query with all
255 fields in the result but this does not work.
Before I show what I already did, I would like to describe the problem
behind:
I have a table with many invoices to one project (an I have many projects).
I know which invoices is the last one. Now, I would like to make a query
that gives me only the last invoices of each project. My field names are:
Project=nr, highest number in last Invoice=KDSTichtag.
I need:
- all 255 fields
- the field names must be the same as in the original table
- I have to show all data of only the record that has the maximum value in
KDSTichtag
I think that a simple grouped query will not do the job. This is where I am
stuck:
The query looks like this
SELECT last(STICHTAG) as Stichtag, max(KDStichtag) as KDStichtag,
last(s_typ) as s_typ, nr, last(mc) as mc, .....etc....
FROM s_ProjektCo
GROUP BY nr ;
Now I have 2 problems:
1) From Excel using ADO
I get the error "Error -2147467259 Too many fields defined. (Source:
Microsoft JET Database Engine) (SQL State: 3190) (NativeError: -68092944)"
The fields are named correctly, however, I can have only 254 fields!
2) Access Query
In Access I get an error (translated): "Alias 'Stichtag' caused a circular
reference in the SELECT-List of the query definition."
To make the query run, I have to use different aliases AND I must delete one
field so that I query only 254 fields.
Best regards
arno