Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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 April 5th, 2004, 01:49 PM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default can someone help me in coding this?

i have a table in which date is written as mm/dd/yyyy now i have a form with a combo box with only year(yyyy) and a buttton which when pressed should generate a report based on a query for that year how can write this query to compare the Year part only.

i mean to say that how do i compare the year in the combo box to the year in the table (not the whole date).


awaiting your replies
thanks in advance



 
Old April 5th, 2004, 02:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Use the YEAR function:

DoCmd.OpenReport "Your Report Name", acViewPreview, , "Year([Your Date Field]) = " & Me.cboYear

Where cboYear is the combobox.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with coding Gini Visual Studio 2008 2 March 6th, 2009 04:14 PM
Coding Help sugunakar Classic ASP Professional 2 March 30th, 2008 04:42 PM
help with coding mastrgamr C++ Programming 15 November 10th, 2006 07:55 AM
Help coding here Scoob PHP How-To 3 January 26th, 2006 11:18 AM
coding mdlan PHP Databases 1 May 28th, 2005 07:40 PM





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