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

Loss of data in query field when selecting the totals

94
I have a basic query [qryGenerateFacilPaymentsStep3] which is selecting all information from another query [qryGenerateFacilPaymentsStep2]. As soon as i set the query to show the totals (in order to perform a sum) all information held in a field named [forenames] is replaced with strage characters like "ᘈ" or "ᘈ".

When removing the totals the forenames are all shown normally again.
I have checked the underlying table which contains the [forenames] field and there is nothing wrong with the data in there. I have also checked my other queries and everything is ok there too.

Does anyone know why this might be happening? It's really frustrating.
Jun 13 '08 #1
8 1505
puppydogbuddy
1,923 Expert 1GB
Sounds like you are encountering nulls in your sum. Try using the NullToZero Numeric function in your summation formula. If you don'tknow how, post the summaion formula you currently have for one of your columns, and I will incorporate the NZ function for you.
Jun 13 '08 #2
Lewe22
94
Not really sure what you mean by summation formulae. What is that and where can i copy it from?

Also, even if i take the sum out but keep the grouping the same thing is happening...
Jun 13 '08 #3
puppydogbuddy
1,923 Expert 1GB
Not really sure what you mean by summation formulae. What is that and where can i copy it from?

Also, even if i take the sum out but keep the grouping the same thing is happening...
The summation formulae would be shown in the sql view of your totals query....but if the loss of data is occuring with the grouping, you probably need to apply the Nz function at the column level. To do that you will have to create an alias column as illustrated below:

fieldX ..............aliasOfFieldX: nz([fieldX], 0)

then group and sum the alias column, not the original column.
Jun 13 '08 #4
NeoPa
32,556 Expert Mod 16PB
You may want to share some more details Lewe.

I'm guessing this may be a GROUPing issue, but we have so little actual information to go on that it's hard to check.
Jun 16 '08 #5
Lewe22
94
I don't really know what was happening here, but i will explain what i did to resolve it.

I had created a series of queries, lets call them query1, query2 and query3.
Each query was perfoming its own task and was then referenced in the next query in sequence. (Eg, query1 was called as a table into query2 etc. etc.

I had linked a table named [tblStudent] into query1. This was showing [title], [forename] and [surname]. That information was then pulled into query2 where a grouping was performed on the data. Then again into query3 where another grouping was performed.

My problem was that in the result set of query3 the data held within the [forename] field was being replaced with strage characters like "ᘈ_" or "ᘈ" for every record as soon as a grouping was applied. When the grouping was removed [forename] would revert back to its original state. Having checked back to query2 it was apparent that this was only happening at query3.

This baffled me for some time as i looked for a possible explanation but to no avail. Perhaps someone here might now know why this was happening? I'd be delighted if someone could enlighten me!

Anyway, to rectify this situation i simply removed [tblStudent] from query1, thus removing [title], [forename] & [surname] from all 3 queries.

I then created query4 and linked tblStudent in at that point. Bingo!

As easy, and maybe as obvious as my resolve was, my main problem is that i always want to know why something has happened. I've lost so many days on this going off on a tangent! Maybe i just need to let this one go!!

Thanks for all your assistance everyone.

Lewe
Jun 23 '08 #6
puppydogbuddy
1,923 Expert 1GB
The only thing that comes to mind is that the data in table1 is at a different level of detail than the data in one or more of your first 3 queries,thus creating a comparison of apple to oranges conflict.
Jun 23 '08 #7
Stewart Ross
2,545 Expert Mod 2GB
I've come across name conflicts in cascaded queries where fields with valid aliases are not resolved correctly by the JET database engine. In the ones that have happened to me, JET has substituted the fully-qualified field name table_x.field_y for the aliased name provided.

This has only happened when there were more than one occurrences of a field within the cascaded queries. For example, academic year occurring in several student-related tables participating in the cascaded queries, leading to JET substituting a fully-qualified name for one of the aliases. This despite all names being correctly aliased in all SQL throughout. I've sometimes had to do daft things, like renaming the alias Session to TheSession to avoid such a name conflict interfering with the end result of the query.

The fact that you succeeded when you deleted a table from one of your cascaded queries then rejoined it back in a later query is quite significant, I think.

-Stewart
Jun 23 '08 #8
Lewe22
94
Thanks again for your time everyone. I'm just glad it's working now and i can move on!
Jun 25 '08 #9

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

Similar topics

4
by: Steve | last post by:
I have a products table where the PK is ProductID. Also have the standard Orders table and OrderDetails table. I created a query that joins the Orders table and OrderDetails table. The query...
3
by: Louis | last post by:
Is there a switch or a setting in Access so that a group by query doesn't return a field name SumOf(original field name)? Especially when you chain multiple queries together you'd get...
3
by: James | last post by:
Hi, I have a combo box(cmboParts) and the row source is a part name. Once a part is selected I have button(cmdOrderAdd) to add data about this part to a sub-form(frmParts_Ordered). However this...
7
by: Neil Ginsberg | last post by:
I'm having some problems with an Access 2000 MDB file with a SQL Server 7 back end, using ODBC linked tables. I previously wrote about this, but am reposting it with some additional information and...
13
by: nyt | last post by:
I have a problem of number and text field. I got the database file(mdb) that contains many combo boxes used and its list values are created by "value list" For eg field Field name= 'furniture'...
7
by: cwhite | last post by:
The answer to this is probably very simple, but it has been a while since I have had to use access. I have two different queries, one counts records: SELECT Closure.Closed_As,...
2
by: Jimmy Stewart | last post by:
Ok, I'm trying to write a query that is starting to wear me down. What I'm trying to do is create a year end report that gets sent to all of my customers who meet two criteria. One they are...
4
by: tweeterbot | last post by:
Hi. I am working in Access 2000 in Windows XP. The problem I am having is very strange. My database has many tables and queries, but the relevant ones here are Pricing and Targets (table),...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.