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 September 4th, 2006, 05:12 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default Query by years

Hi,

  I got an DB which is having the data like name of the programm, Starting Data & End Date ...

 I want to generate the query using the year..
 like what are all the programm coducted from year 2003 to year 2006.. but the problem is iam entring the date, monthl & year in the table how can i get the report what expression should i put in the query..

 And another thing is If an programme stated on 30/12/2005 and ended on 3/1/2006 how the query will take if i give the years as 2004 to 2005 then i ill get that programm details ..but when i give 2006 to 2007 then the record wont appeare but the programme was happaned on the year 2006..

 Plz give me some solution ....if ur not able to understand please revert me...

 Expecting the reply..


Learn as you can..
------------------------
pap...
 
Old September 5th, 2006, 06:51 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   Crete your query, and then add a column with this as the source:

StartYear:(DatePart("yyyy", [StartDate]))

This column will report the following:

StartDate StartYear
30/12/2005 2005
3/1/2006 2006

So pass criteria to [StartYear] like "2005"

You can also add a column for EndYear using the same formula and pass criteria to it.

If you just pass criteria to the StartYear, this will give you programs that started in the scope of your query, regardless of when they ended.

Does that help?


mmcdonal
 
Old September 6th, 2006, 12:19 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

What about the question which i asked

 (And another thing is If an programme stated on 30/12/2005 and ended on 3/1/2006 how the query will take if i give the years as 2004 to 2005 then i ill get that programm details ..but when i give 2006 to 2007 then the record wont appeare but the programme was happaned on the year 2006..)

 Do u have any idea?


Learn as you can..
------------------------
pap...
 
Old September 6th, 2006, 06:11 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

As I said: "If you just pass criteria to the StartYear, this will give you programs that started in the scope of your query, regardless of when they ended."



mmcdonal





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
Years to Months Conversion mahajanvit ASP.NET 2.0 Basics 2 September 25th, 2006 11:43 PM
Pull years from date field kev_79 Access 2 August 2nd, 2004 01:49 PM
leap years & cal_days_in_month richard.york Pro PHP 4 December 27th, 2003 02:15 AM





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