First and Last not working for dates in a query (1 Viewer)

CanvasShoes

Registered User.
Local time
Today, 04:25
Joined
Sep 25, 2009
Messages
25
The dates in this ancient (not my original data, it's data somehow copied off of an old obsolete computer system that I'm just trying to rescue and organize), are formatted like this - 6/19/89. My query is written such that I get a sum of all like material from each supplier.

The purpose is to show a total weight for each supplier for each specific material type so that I don't have 4 gazillion records for each of the deliveries of eggs from farmer Joe (just for instance). I have ONE entry for Farmer Joe for eggs for the total he delivered over a year's period (or more). And maybe a separate record from Farmer Joe for the 20 gazillion deliveries of milk (or something like that).

Anyway, I put the column containing the delivery date in the query twice, once with "First" and once with "Last" (the data came to me with only a delivery date column, I am hoping I don't have to manually split it all up). It seemed to work okay, but the first date is actually older than the last date. It's probably something I did wrong, (and/or crappy data to begin with), but I'm hoping someone might be able to help.

(PS, there is no Farmer Joe :D)
 

John Big Booty

AWF VIP
Local time
Today, 22:25
Joined
Aug 29, 2005
Messages
8,263
With dates, the first date will always be the older date as that clearly came prior to the Last or younger date.
 

Brianwarnock

Retired
Local time
Today, 13:25
Joined
Jun 2, 2003
Messages
12,701
I forget the full info but First and Last don't tend to do what you expect anyway, so you should use Max and Min, for the newest and oldest respectively.

Brian
 

CanvasShoes

Registered User.
Local time
Today, 04:25
Joined
Sep 25, 2009
Messages
25
I forget the full info but First and Last don't tend to do what you expect anyway, so you should use Max and Min, for the newest and oldest respectively.

Brian
What I was looking for is as Big John describes, I used first to denote the oldest dates, and last to denote the most recent (which is about circa 1989 which is probably why some of the errors are happening?). What is weird is that it worked perfectly with one of the queries (same tables used) and the second query (same source data, slightly different requests), it put the dates in backward giving me the most recent dates for "first" and the oldest dates for "last".

I always like to know why the errors happened in case it's something I can learn, but the min/max worked perfectly, thanks so much! :)
 

Users who are viewing this thread

Top Bottom