Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 29th, 2004, 10:07 AM
kat kat is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 15 kat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
extracting data from current month

I'm trying to extract certain data from the current month but do not know how to do this. Any suggestions?

Reply With Quote
  #2  
Old September 29th, 2004, 02:45 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 4
Make a query from your table/query and in the query grid select the field that is used as your date and any additional fields that you want to make additional selections from. Place your date field as the first column or after the column of your primary key if selected.
To get the current month from your date field, provided that you are using the mm/dd/yyyy format place this in the criteria section under your date field that represents your date ... Format([Table/QueryName]![DateFieldName],"m")=Format(Date(),"m")

Use the name of the table or query and the name of the actual date field used in your application to replace what was shown above in italics. This will select the current month. Then you can add the additional criteria for the other fields that you need selected or sorted.

lwells

Reply With Quote
  #3  
Old October 4th, 2004, 08:58 AM
kat kat is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 15 kat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile It works!

Thanks lwells! It worked! U r a star!

Reply With Quote
  #4  
Old October 6th, 2004, 04:21 AM
kashif kashif is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 3 kashif User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What if we use the dd-mm-yy

what if we use the dd-mm-yy.format what we have to do

Reply With Quote
  #5  
Old October 6th, 2004, 10:22 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 4
It would still be the same. In the criteria under the date field in your query that you want to sort on:

Examples

Format(Date(),"mm") This will give the current month for all years
Format(Date(),"mm-yy") This will give the current month for the current year.
Format(Date(),"dd-mm-yy") This will give the current day, current month and current year.
Format(Date(),"dd-yy") This would give the current day for all months in the current year.

Depending on how you want the records sorted, just change the format to suit your needs.

Hope this helps.

lwells

Reply With Quote
  #6  
Old November 14th, 2004, 10:24 AM
Rishyraj Rishyraj is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 53 Rishyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m
Reputation Power: 4
Exclamation Can any one please help regarding chaning date to month

Hi,

I have lot of transactions, in various months, under different dates. When i make a query, i want the all the dates in a month to be named after that specific month.

Example:

11/15/2004 - Should read as november,2004

11/16/2004 - should read as november, 2004.

12/06/2004 - shoud read as december, 2004

This would help me in report, so that i can group them by month and get the overall transaction values.

Can any one help me.

Iwells, you seem to be guru. I tried the above reply u wrote to Kat. That gives me only for the current month. Can you please extend it to all months.

Thankyou

Reply With Quote
  #7  
Old November 14th, 2004, 03:08 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 4
Hi Rishyraj,

In your query make a new expression and give it whatever name you like:

Format([YourDate],"mmmm" & " " & "yyyy") Gives Month and Year with a space between them
Format([YourDate],"mmmm" & ", " & "yyyy") Gives Month and Year with a comma between them

In your report group by the name you have given this expression.

lwells

Reply With Quote
  #8  
Old November 14th, 2004, 10:27 PM
Rishyraj Rishyraj is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 53 Rishyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m
Reputation Power: 4
Smile Thank you

Hi Iwells,

Thank you very much. You make life easy. Thanks for your help.

Rishy




Quote:
Originally Posted by lwells
Hi Rishyraj,

In your query make a new expression and give it whatever name you like:

Format([YourDate],"mmmm" & " " & "yyyy") Gives Month and Year with a space between them
Format([YourDate],"mmmm" & ", " & "yyyy") Gives Month and Year with a comma between them

In your report group by the name you have given this expression.

lwells

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > extracting data from current month


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway