If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Group by Quarters Using Characters
Hello all,
I have a report based on a table that contains various dates throughout a year. I wish the report to group by the monthly quarters 1 -4. This I have managed with the statement below: Quarter: "Q" & CStr(DatePart("q", [DateOfBirth])) However, the reports groups on the heading Q1, Q2 etc. Is it possble to show the month characters as in Jan-Mar, Apr-Jun instead of the Q1, Q2. Thanks for taking the time to read this. All help and guidence welcome :-) Debbie D. (UK) |
#2
|
|||
|
|||
Group by Quarters Using Characters
probably the easiest way would be to use a SQL statement as the RecordSource
for your report, as SELECT *, DatePart("q",[DateOfBirth]) AS Qtr FROM TableName; substitute the correct table name, of course. if your report is bound to a query, rather than to a table, then instead of changing the report's RecordSource, simply add the calculated field into the existing query, as Qtr: DatePart("q",[DateOfBirth]) *group* the report on the Qtr field, so the quarters will be in numeric order. in the group Header section, add an unbound text box with its' ControlSource set to the following expression, as =Choose([Qtr],"Jan - Mar","Apr - Jun","Jul - Sep","Oct - Dec") hth "Debbie D." wrote in message ... Hello all, I have a report based on a table that contains various dates throughout a year. I wish the report to group by the monthly quarters 1 -4. This I have managed with the statement below: Quarter: "Q" & CStr(DatePart("q", [DateOfBirth])) However, the reports groups on the heading Q1, Q2 etc. Is it possble to show the month characters as in Jan-Mar, Apr-Jun instead of the Q1, Q2. Thanks for taking the time to read this. All help and guidence welcome :-) Debbie D. (UK) |
#3
|
|||
|
|||
Group by Quarters Using Characters
Debbie D. wrote:
I have a report based on a table that contains various dates throughout a year. I wish the report to group by the monthly quarters 1 -4. This I have managed with the statement below: Quarter: "Q" & CStr(DatePart("q", [DateOfBirth])) However, the reports groups on the heading Q1, Q2 etc. Is it possble to show the month characters as in Jan-Mar, Apr-Jun instead of the Q1, Q2. Use a text box expression like: =MonthName(3*(DatePart("q",Date+99)-1)+1,True) & "-" & MonthName(3*DatePart("q",Date),True) -- Marsh MVP [MS Access] |
#4
|
|||
|
|||
Group by Quarters Using Characters
Marshall, you have my many thanks. Debbie D.
"Marshall Barton" wrote: Debbie D. wrote: I have a report based on a table that contains various dates throughout a year. I wish the report to group by the monthly quarters 1 -4. This I have managed with the statement below: Quarter: "Q" & CStr(DatePart("q", [DateOfBirth])) However, the reports groups on the heading Q1, Q2 etc. Is it possble to show the month characters as in Jan-Mar, Apr-Jun instead of the Q1, Q2. Use a text box expression like: =MonthName(3*(DatePart("q",Date+99)-1)+1,True) & "-" & MonthName(3*DatePart("q",Date),True) -- Marsh MVP [MS Access] |
#5
|
|||
|
|||
Group by Quarters Using Characters
Thank you Tina for your reply. Superstar!!
"tina" wrote: probably the easiest way would be to use a SQL statement as the RecordSource for your report, as SELECT *, DatePart("q",[DateOfBirth]) AS Qtr FROM TableName; substitute the correct table name, of course. if your report is bound to a query, rather than to a table, then instead of changing the report's RecordSource, simply add the calculated field into the existing query, as Qtr: DatePart("q",[DateOfBirth]) *group* the report on the Qtr field, so the quarters will be in numeric order. in the group Header section, add an unbound text box with its' ControlSource set to the following expression, as =Choose([Qtr],"Jan - Mar","Apr - Jun","Jul - Sep","Oct - Dec") hth "Debbie D." wrote in message ... Hello all, I have a report based on a table that contains various dates throughout a year. I wish the report to group by the monthly quarters 1 -4. This I have managed with the statement below: Quarter: "Q" & CStr(DatePart("q", [DateOfBirth])) However, the reports groups on the heading Q1, Q2 etc. Is it possble to show the month characters as in Jan-Mar, Apr-Jun instead of the Q1, Q2. Thanks for taking the time to read this. All help and guidence welcome :-) Debbie D. (UK) |
#6
|
|||
|
|||
Group by Quarters Using Characters
you're welcome
"Debbie D." wrote in message ... Thank you Tina for your reply. Superstar!! "tina" wrote: probably the easiest way would be to use a SQL statement as the RecordSource for your report, as SELECT *, DatePart("q",[DateOfBirth]) AS Qtr FROM TableName; substitute the correct table name, of course. if your report is bound to a query, rather than to a table, then instead of changing the report's RecordSource, simply add the calculated field into the existing query, as Qtr: DatePart("q",[DateOfBirth]) *group* the report on the Qtr field, so the quarters will be in numeric order. in the group Header section, add an unbound text box with its' ControlSource set to the following expression, as =Choose([Qtr],"Jan - Mar","Apr - Jun","Jul - Sep","Oct - Dec") hth "Debbie D." wrote in message ... Hello all, I have a report based on a table that contains various dates throughout a year. I wish the report to group by the monthly quarters 1 -4. This I have managed with the statement below: Quarter: "Q" & CStr(DatePart("q", [DateOfBirth])) However, the reports groups on the heading Q1, Q2 etc. Is it possble to show the month characters as in Jan-Mar, Apr-Jun instead of the Q1, Q2. Thanks for taking the time to read this. All help and guidence welcome :-) Debbie D. (UK) |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I give rights to a group to access my calendar in Outlook | Mike H | Calendar | 5 | December 10th, 2005 01:07 AM |
O.E. Address Book Groups | Joy | Outlook Express | 12 | February 2nd, 2005 04:13 AM |
BUG: Using GROUP BY in query expression on MEMO fields it truncates data in MEMO fields to first 255 characters | [SolarAngel] | Running & Setting Up Queries | 5 | December 7th, 2004 06:29 PM |
BUG: Using GROUP BY in query expression on MEMO fields it truncates data in MEMO fields to first 255 characters | [SolarAngel] | Setting Up & Running Reports | 5 | December 7th, 2004 06:29 PM |
Electronic Price List | Jono | General Discussion | 2 | September 28th, 2004 03:59 PM |