Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 2nd, 2004, 08:57 AM
Authorized User
 
Join Date: Jun 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kev_79
Default Pull years from date field

All,

I have a field of dates that some collections occured. I am needing to compile a report that has the years collected (i.e. 2000,2002) Has anyone done this, and if so, could you point me in the right direction.

Thanks,
Kevin
 
Old August 2nd, 2004, 01:39 PM
Authorized User
 
Join Date: Jul 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

select distinct year(datefield) from table

this will return unique years that exist in the field specified.
 
Old August 2nd, 2004, 01:49 PM
Authorized User
 
Join Date: Jun 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kev_79
Default

Thanks!!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
date conversion in years, months and days naveed77 Beginning VB 6 0 January 2nd, 2008 01:18 AM
adding years to date Israr JSP Basics 1 March 23rd, 2007 07:56 AM
Can't pull data from ntext field into recordset. rstelma SQL Server 2000 2 August 26th, 2003 04:50 PM
Can't pull data from ntext field into recordset. rstelma Classic ASP Databases 1 August 26th, 2003 03:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.