Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 4th, 2006, 05:12 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
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...
Reply With Quote
  #2 (permalink)  
Old September 5th, 2006, 06:51 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #3 (permalink)  
Old September 6th, 2006, 12:19 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
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...
Reply With Quote
  #4 (permalink)  
Old September 6th, 2006, 06:11 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:21 AM.


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