473,395 Members | 1,377 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,395 software developers and data experts.

A2K: Report formatting issue grouping on "Fld<>'Value'"

Hello.

Using A2K SP3, I am having the following problem with a report using
"Sorting and Grouping".

I have recently added a grouping in the reports for
"Category2<>'CONTRACTS'".

I have reports at the plan (overall totals), department and division
levels which have sorting and grouping implemented with this new
grouping. The first
two reports work as expected. However, for the division level report,
the Access report is not grouping as expected. See details below.

For the report which does not work, the source is an SQL statement as
follows...

TRANSFORM Sum(ytdIA2004.Amount) AS [The Value]
SELECT mapTransfers.Department, mapTransfers.Division,
dicPayCodes.Category2<>'CONTRACTS' AS CatContractsYN,
dicPayCodes.Category2, Sum(ytdIA2004.Amount) AS [Year To Date]
FROM (ytdIA2004 LEFT JOIN dicPayCodes ON ytdIA2004.[PayCode#] =
dicPayCodes.[PayCode#])
LEFT JOIN mapTransfers ON (ytdIA2004.[IDX Program] =
mapTransfers.[IDX Program]) AND
(ytdIA2004.[IDX Billing Area] = mapTransfers.[IDX Billing Area]) AND
(ytdIA2004.[IDX Division] = mapTransfers.[IDX Division])
WHERE (ytdIA2004.[Income Type] = 'Payments' OR ytdIA2004.[Income Type]
= 'Refunds') AND
ytdIA2004.[PayCode#] Is Not Null AND ytdIA2004.[Date] <= #05/01/2004#
GROUP BY mapTransfers.Department, mapTransfers.Division,
dicPayCodes.Category2<>'CONTRACTS', dicPayCodes.Category2
PIVOT Format([Date],'mmm') In
('Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb',' Mar','Apr','May','Jun');

The Access report has the following "sorting and grouping"
specifications:

Department Ascending (with no group header or footer)
Division Ascending (with no group header but a group footer)
CatContractsYN Ascending (with both a group header and group footer)
Category2 Ascending (with no group header or footer)

For all of the above, the other settings are as follows
Group On: Each Value
Interval: 1
Keep Together: No

I am expecting to see multiple records with Category2<>'CONTRACTS'
(which evaluates to "-1") in the first group and one record with
Category2='CONTRACTS' (which evalueates to '0') in the second group
for "CatContractsYN". This works for the plan and department level
reports.

However, for this division level report, I see only one record in the
first group (for the first department & division on the report) and
one record (which is not for Category2='CONTRACTS') in the second
group. In addition, if I go to page 3 of the report, I get multiple
"No current record" messages. Somehow,
the report's source data is not being matched up correctly to the
report definition.

If I take out the header AND footer for the CatContractsYN group, the
report groups correctly. However, putting in a header or footer for
this group results in the problem.

I have tried running the source query independently and it seems to
group and sort as expected. The issue seems to be with the report
design.

I would appreciate any ideas.

Thanks,
Ahsan
Nov 13 '05 #1
3 2698
The query conatins a calculated field named CatContractsYN.

Try using that name in the Sorting'n'Grouping dialog instead of the
expression.

BTW, you will get 3 groups of records. The field is on the outer side of the
join, so even if it is a required field it can have 3 possible values in the
query: Null, True, and False.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<ah******@hotmail.com> wrote in message
news:a2**************************@posting.google.c om...

Using A2K SP3, I am having the following problem with a report using
"Sorting and Grouping".

I have recently added a grouping in the reports for
"Category2<>'CONTRACTS'".

I have reports at the plan (overall totals), department and division
levels which have sorting and grouping implemented with this new
grouping. The first
two reports work as expected. However, for the division level report,
the Access report is not grouping as expected. See details below.

For the report which does not work, the source is an SQL statement as
follows...

TRANSFORM Sum(ytdIA2004.Amount) AS [The Value]
SELECT mapTransfers.Department, mapTransfers.Division,
dicPayCodes.Category2<>'CONTRACTS' AS CatContractsYN,
dicPayCodes.Category2, Sum(ytdIA2004.Amount) AS [Year To Date]
FROM (ytdIA2004 LEFT JOIN dicPayCodes ON ytdIA2004.[PayCode#] =
dicPayCodes.[PayCode#])
LEFT JOIN mapTransfers ON (ytdIA2004.[IDX Program] =
mapTransfers.[IDX Program]) AND
(ytdIA2004.[IDX Billing Area] = mapTransfers.[IDX Billing Area]) AND
(ytdIA2004.[IDX Division] = mapTransfers.[IDX Division])
WHERE (ytdIA2004.[Income Type] = 'Payments' OR ytdIA2004.[Income Type]
= 'Refunds') AND
ytdIA2004.[PayCode#] Is Not Null AND ytdIA2004.[Date] <= #05/01/2004#
GROUP BY mapTransfers.Department, mapTransfers.Division,
dicPayCodes.Category2<>'CONTRACTS', dicPayCodes.Category2
PIVOT Format([Date],'mmm') In
('Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb',' Mar','Apr','May','Jun');

The Access report has the following "sorting and grouping"
specifications:

Department Ascending (with no group header or footer)
Division Ascending (with no group header but a group footer)
CatContractsYN Ascending (with both a group header and group footer)
Category2 Ascending (with no group header or footer)

For all of the above, the other settings are as follows
Group On: Each Value
Interval: 1
Keep Together: No

I am expecting to see multiple records with Category2<>'CONTRACTS'
(which evaluates to "-1") in the first group and one record with
Category2='CONTRACTS' (which evalueates to '0') in the second group
for "CatContractsYN". This works for the plan and department level
reports.

However, for this division level report, I see only one record in the
first group (for the first department & division on the report) and
one record (which is not for Category2='CONTRACTS') in the second
group. In addition, if I go to page 3 of the report, I get multiple
"No current record" messages. Somehow,
the report's source data is not being matched up correctly to the
report definition.

If I take out the header AND footer for the CatContractsYN group, the
report groups correctly. However, putting in a header or footer for
this group results in the problem.

I have tried running the source query independently and it seems to
group and sort as expected. The issue seems to be with the report
design.

I would appreciate any ideas.

Thanks,
Ahsan

Nov 13 '05 #2
Hello.

The "Sorting and Grouping" dialog is using the calculated field
"CatContractsYN". When the query is run directly, it results in 1 or
2 groups for all the divisions (with 2 groups for the first division
output on the report). However, I understand your note about a
possible third Null outcome. I'll check into how to ensure 2 or less
outcomes...

The thing to note is that the same approach for the Plan and
Department level reports works.

The lines of data which show up in the 2 groups on the first page and
the 1 group on the second page of the report are all supposed to be in
the first group (first dept-division combination for
Category2<>'CONTRACTS'). Also, the totals for the first group, second
group and overall division total are all correct for the first
dept-division combination. It is somehow just not putting the details
into the correct groups (based on the calculated field
"CatContractsYN") when a header or footer (even if it's blank) is
specified for this group.

Thanks for any more input.

Ahsan

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message news:<40***********************@per-qv1-newsreader-01.iinet.net.au>...
The query conatins a calculated field named CatContractsYN.

Try using that name in the Sorting'n'Grouping dialog instead of the
expression.

BTW, you will get 3 groups of records. The field is on the outer side of the
join, so even if it is a required field it can have 3 possible values in the
query: Null, True, and False.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<ah******@hotmail.com> wrote in message
news:a2**************************@posting.google.c om...

Using A2K SP3, I am having the following problem with a report using
"Sorting and Grouping".

I have recently added a grouping in the reports for
"Category2<>'CONTRACTS'".

I have reports at the plan (overall totals), department and division
levels which have sorting and grouping implemented with this new
grouping. The first two reports work as expected. However, for the
division level report, the Access report is not grouping as expected.
See details below.

For the report which does not work, the source is an SQL statement as
follows...

TRANSFORM Sum(ytdIA2004.Amount) AS [The Value]
SELECT mapTransfers.Department, mapTransfers.Division,
dicPayCodes.Category2<>'CONTRACTS' AS CatContractsYN,
dicPayCodes.Category2, Sum(ytdIA2004.Amount) AS [Year To Date]
FROM (ytdIA2004 LEFT JOIN dicPayCodes ON ytdIA2004.[PayCode#] =
dicPayCodes.[PayCode#])
LEFT JOIN mapTransfers ON (ytdIA2004.[IDX Program] =
mapTransfers.[IDX Program]) AND
(ytdIA2004.[IDX Billing Area] = mapTransfers.[IDX Billing Area]) AND
(ytdIA2004.[IDX Division] = mapTransfers.[IDX Division])
WHERE (ytdIA2004.[Income Type] = 'Payments' OR ytdIA2004.[Income Type]
= 'Refunds') AND
ytdIA2004.[PayCode#] Is Not Null AND ytdIA2004.[Date] <= #05/01/2004#
GROUP BY mapTransfers.Department, mapTransfers.Division,
dicPayCodes.Category2<>'CONTRACTS', dicPayCodes.Category2
PIVOT Format([Date],'mmm') In
('Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb',' Mar','Apr','May','Jun');

The Access report has the following "sorting and grouping"
specifications:

Department Ascending (with no group header or footer)
Division Ascending (with no group header but a group footer)
CatContractsYN Ascending (with both a group header and group footer)
Category2 Ascending (with no group header or footer)

For all of the above, the other settings are as follows
Group On: Each Value
Interval: 1
Keep Together: No

I am expecting to see multiple records with Category2<>'CONTRACTS'
(which evaluates to "-1") in the first group and one record with
Category2='CONTRACTS' (which evalueates to '0') in the second group
for "CatContractsYN". This works for the plan and department level
reports.

However, for this division level report, I see only one record in the
first group (for the first department & division on the report) and
one record (which is not for Category2='CONTRACTS') in the second
group. In addition, if I go to page 3 of the report, I get multiple
"No current record" messages. Somehow, the report's source data is not
being matched up correctly to the report definition.

If I take out the header AND footer for the CatContractsYN group, the
report groups correctly. However, putting in a header or footer for
this group results in the problem.

I have tried running the source query independently and it seems to
group and sort as expected. The issue seems to be with the report
design.

I would appreciate any ideas.

Thanks,
Ahsan

Nov 13 '05 #3
Hello.

I wanted to let you know that I came up with a workaround for this
issue.

It seems that this scenario doesn't work because it involves grouping
(with a header or footer) on an expression which can result in True
(-1), False (0) or Null IF this is done on the third grouping level
(or later). I had the same error when I added a Yes/No field in the
dicPaycodes table which indicated if Category2 is 'Contracts' or not
and used this field to group on.

What I had to do was to add a text field (length 5) in dicPayCodes.
This field
(Cat2Contracts) has value "Yes" if dicPayCodes.Category2='Contracts'
and
"No" otherwise. My report(s) are now selecting this field and
grouping by
it instead of the expression "dicPayCodes.Category2<>'CONTRACTS'.

This will require us to update this field when the value for Category2
is
changed (or set for a new record). This will be done via the
AfterUpdate()
method for the Category2 control on the PayCodes form (where users add
or
edit records).

If you come up with a possible solution for the original problem,
please let
me know.

Thanks,
Ahsan

ah******@hotmail.com (ah******@hotmail.com) wrote in message news:<a2************************@posting.google.co m>...
Hello.

The "Sorting and Grouping" dialog is using the calculated field
"CatContractsYN". When the query is run directly, it results in 1 or
2 groups for all the divisions (with 2 groups for the first division
output on the report). However, I understand your note about a
possible third Null outcome. I'll check into how to ensure 2 or less
outcomes...

The thing to note is that the same approach for the Plan and
Department level reports works.

The lines of data which show up in the 2 groups on the first page and
the 1 group on the second page of the report are all supposed to be in
the first group (first dept-division combination for
Category2<>'CONTRACTS'). Also, the totals for the first group, second
group and overall division total are all correct for the first
dept-division combination. It is somehow just not putting the details
into the correct groups (based on the calculated field
"CatContractsYN") when a header or footer (even if it's blank) is
specified for this group.

Thanks for any more input.

Ahsan

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message news:<40***********************@per-qv1-newsreader-01.iinet.net.au>...
The query conatins a calculated field named CatContractsYN.

Try using that name in the Sorting'n'Grouping dialog instead of the
expression.

BTW, you will get 3 groups of records. The field is on the outer side of the
join, so even if it is a required field it can have 3 possible values in the
query: Null, True, and False.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<ah******@hotmail.com> wrote in message
news:a2**************************@posting.google.c om...

Using A2K SP3, I am having the following problem with a report using
"Sorting and Grouping".

I have recently added a grouping in the reports for
"Category2<>'CONTRACTS'".

I have reports at the plan (overall totals), department and division
levels which have sorting and grouping implemented with this new
grouping. The first two reports work as expected. However, for the
division level report, the Access report is not grouping as expected.
See details below.

For the report which does not work, the source is an SQL statement as
follows...

TRANSFORM Sum(ytdIA2004.Amount) AS [The Value]
SELECT mapTransfers.Department, mapTransfers.Division,
dicPayCodes.Category2<>'CONTRACTS' AS CatContractsYN,
dicPayCodes.Category2, Sum(ytdIA2004.Amount) AS [Year To Date]
FROM (ytdIA2004 LEFT JOIN dicPayCodes ON ytdIA2004.[PayCode#] =
dicPayCodes.[PayCode#])
LEFT JOIN mapTransfers ON (ytdIA2004.[IDX Program] =
mapTransfers.[IDX Program]) AND
(ytdIA2004.[IDX Billing Area] = mapTransfers.[IDX Billing Area]) AND
(ytdIA2004.[IDX Division] = mapTransfers.[IDX Division])
WHERE (ytdIA2004.[Income Type] = 'Payments' OR ytdIA2004.[Income Type]
= 'Refunds') AND
ytdIA2004.[PayCode#] Is Not Null AND ytdIA2004.[Date] <= #05/01/2004#
GROUP BY mapTransfers.Department, mapTransfers.Division,
dicPayCodes.Category2<>'CONTRACTS', dicPayCodes.Category2
PIVOT Format([Date],'mmm') In
('Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb',' Mar','Apr','May','Jun');

The Access report has the following "sorting and grouping"
specifications:

Department Ascending (with no group header or footer)
Division Ascending (with no group header but a group footer)
CatContractsYN Ascending (with both a group header and group footer)
Category2 Ascending (with no group header or footer)

For all of the above, the other settings are as follows
Group On: Each Value
Interval: 1
Keep Together: No

I am expecting to see multiple records with Category2<>'CONTRACTS'
(which evaluates to "-1") in the first group and one record with
Category2='CONTRACTS' (which evalueates to '0') in the second group
for "CatContractsYN". This works for the plan and department level
reports.

However, for this division level report, I see only one record in the
first group (for the first department & division on the report) and
one record (which is not for Category2='CONTRACTS') in the second
group. In addition, if I go to page 3 of the report, I get multiple
"No current record" messages. Somehow, the report's source data is not
being matched up correctly to the report definition.

If I take out the header AND footer for the CatContractsYN group, the
report groups correctly. However, putting in a header or footer for
this group results in the problem.

I have tried running the source query independently and it seems to
group and sort as expected. The issue seems to be with the report
design.

I would appreciate any ideas.

Thanks,
Ahsan

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David W. Fenton | last post by:
I was creating a very simple report today, a deposit slip report that displays payments grouped by date of payment and then by payment type -- very straightforward, the kind of report I've created...
0
by: Jim Allard | last post by:
Hi, I have an A97 database that has been in use for some 6 years now. There are two reports that each generate an xls document for import into an accounting package. There are two date fields in...
3
by: John Baker | last post by:
Hi: I have, I hope, a trivial formatting issue. I have a field that I wish to format as 12.30 (00.00). IN other words two digits decimal point and two digits. Using the format command (in a...
6
by: Dave | last post by:
I was curious in regards to Access 12; specifically more fluent report formatting. I'm an average user, but from my end, I find more and more need for cleaner reports....and do not always want...
3
by: lmawler | last post by:
Hi everyone, I'm making reports that are based on queries, and the data has several levels of grouping. I have set up a report with several nested group headers, but I'm currently stuck where...
5
by: CarrieR | last post by:
I am working within a DB I have been devolping in Access 2003, and have encountered a report coding issue I was hoping someone could help me with: I have 18 reports, each running off some smaller...
4
by: lupo666 | last post by:
Hi everybody, this time I have three problems driving me nuts :-((( (1) I have a report with 20 or so Yes/No "squares". Is there a way to either hide/show the "square" or change the yes/no...
1
by: cbnewman | last post by:
What is the best way to accomplish the following: I would like to generate a report that changes the text size and italicization based on a boolean variable (present in the row of the data...
10
by: sara | last post by:
Hi - I have a report that is 14 columnar sub-reports (Line up: Position- holders in each of our 14 locations - Manager, Assistant Manager, Receiving, Office, etc). I output directly to PDF...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.