[AccessD] Get top dates from table.

Darren - Active Billing darren at activebilling.com.au
Mon Nov 15 23:33:32 CST 2010


Hey Dazza
Off the top of my (very bald) head - I'd try a group by on the field that
holds the date

E.g. something like...

select SomeDate as SomeCoolDate, Count(*) as CountOfItems from SomeTable
Group by SomeDate
Order by SomeDate

Many thanks

Darren

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl Collins
Sent: Tuesday, 16 November 2010 4:00 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Get top dates from table.


____________________________________________________________________________
___________

Note: This e-mail is subject to the disclaimer contained at the bottom of
this message.
____________________________________________________________________________
___________



Hi guys and gals.

I have a friend at work trying something crafty.  He has a table which
consists of many dates.  he wants a query that returns the top date from
each possible date range.  A simple example below.

1-Nov-2010  1
1-Nov-2010  2
1-Nov-2010  3
1-Nov-2010  4
2-Nov-2010  1
2-Nov-2010  2
2-Nov-2010  3
3-Nov-2010  1
4-Nov-2010  1
4-Nov-2010  2
4-Nov-2010  3
5-Nov-2010  1

Should return

1-Nov-2010  1
2-Nov-2010  1
3-Nov-2010  1
4-Nov-2010  1
5-Nov-2010  1

Having a senior's moment with this.  Any pointers?  Annoyingly I already
know how to do it in Excel :)

cheers
Darryl.
____________________________________________________________________________
___________

The information transmitted in this message and its attachments (if any) is
intended only for the person or entity to which it is addressed.
The message may contain confidential and/or privileged material. Any review,
retransmission, dissemination or other use of, or taking of any action in
reliance upon this information, by persons or entities other than the
intended recipient is prohibited.

If you have received this in error, please contact the sender and delete
this e-mail and associated material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or
distribute the information contained in this e-mail and any attached files,
with the permission of the sender.

This message has been scanned for viruses.
____________________________________________________________________________
___________

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list