|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Thanks lwells! It worked! U r a star!
|
|
#4
|
|||
|
|||
|
What if we use the dd-mm-yy
what if we use the dd-mm-yy.format what we have to do
|
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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 |
|
#8
|
|||
|
|||
|
Hi Iwells,
Thank you very much. You make life easy. Thanks for your help. Rishy Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > extracting data from current month |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|