473,382 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Select Query grouping by month

10
Hi Everyone.
First time here and what a site, my hat off to all the boffins here. I have looked though the forum and have found many interesting threads and could spend hours just crusing though the pages But time moves on.

I am reletively new to access, and there maybe something that i am missing.

What I would like to be able to do:- using a select query, is select all records in a table that fall into the current month. I can do it using "between [start date] and [end Date]". however I would like to be able to do it without having to enter the date sequence, and base the query on "date()" i.e the current month.

I do so hope that some of you clever people have an idea, or perhaps could point me in the right direction.

Thanks in advance for your troubles and keep up the good work. :-)
Aug 8 '08 #1
4 1992
hjozinovic
167 100+
hey Scottie!
welcome to bytes :-)
You can make this by using Format function or DatePart function...
[HTML]1. Create a new field for months:
DateMonth: Format([OldDate];"mm.yyyy")
2. In CurrentMonth criteria row put:
=Format(Now();"mm.yyyy")[/HTML]
In step 1. you isolate the month and the year for the date field.
In step 2. you select only dates from current month (and current year)
Aug 8 '08 #2
scottie
10
hjozinovic, Thank you so very very much!!!!!!

Just one thing that had me foxed for a bit was the use of the ; I kept getting a syntax error, but on changing it to a , comma it worked a treat.

Thanks again
Scottie
Aug 8 '08 #3
hjozinovic
167 100+
hjozinovic, Thank you so very very much!!!!!!

Just one thing that had me foxed for a bit was the use of the ; I kept getting a syntax error, but on changing it to a , comma it worked a treat.

Thanks again
Scottie
I'm glad you did it! God work scottie!
Concerning ";" I'm in Croatia and that sign works for me in queries, but I also switch to "," when using VBA ;-)
Aug 8 '08 #4
youmike
69
Another way of doing what you want is to use the function "DatePart". It works both in VBA and in SQL and has a range of alternative search parameters. Look it up in the help file.
Aug 9 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: JohnnyOnTheSpot | last post by:
If I select from a table and, for example, group by the month or day to determine how much activity there is day to day or month to month, it will only return months and days with a record and...
4
by: Mick White | last post by:
mysql> select * from guestbook; +----+--------+---------+-----------------+----------------+ | id | fname | lname | comments | time_in |...
5
by: Terri | last post by:
The following query will give me the top ten states with the most callers. SELECT TOP 10 Count(Callers.CallerID) AS CountOfCallerID, Callers.State FROM Callers GROUP BY Callers.State ORDER BY...
1
by: John | last post by:
I'm building a report where each row represents one month and its 1 to 5 weeks. A report query groups the source table date into a "month and year" expression. A subreport links to the main report...
3
by: Hanif Merali | last post by:
Hello, I'm having some difficulties creating a make table query. The source table which I'm basing the make table query has the fields: CIF BusLine1-2001 BusLine1-2002 BusLine1-2003...
1
by: bmoos1 | last post by:
I need to make a Report of all people starting in 2004 by "Date Requested". Dates are entered as mm/dd/yyyy. I have a query that has all the people that started in 2004, but there are numerous...
4
by: Kris Rudin | last post by:
I am displaying a table of information on a web page, using an asp:table that I populate dynamically. On this page I give the user the options to group the rows by certain fields, and/or filter the...
3
by: HowHow | last post by:
I need to sort the "DateOfBirth" by the day (dd) regarless of month (mm)and year (yyyy). I have a query called q_DC_Client, in criteria, I am using this code below: Like "*" & "/" & !! & "/" & "*"...
22
by: Rickster66 | last post by:
As Instructed this is a new thread regarding my original post: "Select Only 10 Columns Going Back" I'm sorry for the late response. I've been gathering up information and carefully with as much...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.