Trying to understand Group By



Hi all... I have a quick question, if anyone knows the answer. I've
built a query which looks at a set of records in a table (tblFilename)
and I've set it up so that it displays the following fields:
filename, filedate, origin

Let me first explain the data - filename contains filenames, of which
there could be multiple items... filedate is the respective date stamp
from the filename listed... origin is the folder name where the file
is located.

My query takes the max of filedate, which (to my understanding) would
eliminate all of the other records that have multiple filedate records
(it would only keep the newest one), leaving me with a list of unique
filenames. This works - as long as I am only trying to get two fields
- filename and filedate. As soon as I add "origin" as another field
(it throws a "Group By" in the Total: section), I get all the records
in the table. It no longer tosses out the older dates. So my question
is - why does this happen? Shouldn't I be able to get the related
'origin' field information of the records that I'm keeping? Is it the
"Group By" that is causing my grief? Keep in mind that I'm staying
within the query builder - my SQL skills aren't too strong. However, I
HAVE tried adding DISTINCT to the select statement, but it doesn't
reduce the resulting records that my query produces.
Maybe I'm not explaining myself very well - I'm not entirely sure. If
anyone has an idea, could you please set me straight? Thanks!
-Terry

.



Relevant Pages

  • Re: Trying to understand Group By
    ... filename, filedate, origin ... filedate is the respective date ... My query takes the max of filedate, ... eliminate all of the other records that have multiple filedate records ...
    (comp.databases.ms-access)
  • Re: Trying to understand Group By
    ... filename, filedate, origin ... filedate is the respective date ... My query takes the max of filedate, ... eliminate all of the other records that have multiple filedate records ...
    (comp.databases.ms-access)
  • Help, please. Unneeded variable replacement verbiage spooled to output file.
    ... I have created a query file that I run from a batch that calls ... column filename_column new_value filename ... column backday_column new_value backday ... spool &filename ...
    (comp.databases.oracle.server)
  • Re: Help, please. Unneeded variable replacement verbiage spooled to output file.
    ... I have created a query file that I run from a batch that calls ... column filename_column new_value filename ... column backday_column new_value backday ... spool &filename ...
    (comp.databases.oracle.server)
  • Re: OutputTo: Path Name Using [Forms]!
    ... Where is the macro called ... A query is run, which asks for a date to use as a condition for the query. ... > needs to be in the filename is not the same date that the query is actually ... > tried to OutputTo that form using the same method. ...
    (microsoft.public.access.macros)

Loading