Question about query. (1 Viewer)

GaDauBac

Member
Local time
Today, 14:36
Joined
Mar 22, 2021
Messages
42
Hi everybody!
I have 1 database with the following error:
- At the query "qrGiaTriHD" when opened, it reported an error that did not enter "TongTT" and "TienGiamGia" but still reported correctly. How to not get such an error?
- How does Query display like this?
Capture.JPG

I attached the database.
Thank you everyone!
 

Attachments

  • Total.accdb
    3.4 MB · Views: 156

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 02:36
Joined
Feb 28, 2001
Messages
27,222
The items TongTT and TienGiamGia would appear to have been either spelled incorrectly or not properly qualified as to where they can be found. The "Input Box" that kicks in when you open the query is telling you that the items it is asking for were not available to it from a table when Access tried to open the query. You should verify the spelling of the items that are missing. Note that since the two items you called out are, in fact, aliases for another field, it may be that the underlying field to the alias is the problem.

You may also have a second problem, OR it might be related to the first one. You have three tables in your query with one relationship directly from the 1st to the 3rd table, but the other relationship goes through the 2nd table. This means that you have an ambiguous path from beginning to end for that relationship, and that can confuse Access. So I can't guarantee you that the error of the missing data isn't due to this ambiguous path.
 

GaDauBac

Member
Local time
Today, 14:36
Joined
Mar 22, 2021
Messages
42
The items TongTT and TienGiamGia would appear to have been either spelled incorrectly or not properly qualified as to where they can be found. The "Input Box" that kicks in when you open the query is telling you that the items it is asking for were not available to it from a table when Access tried to open the query. You should verify the spelling of the items that are missing. Note that since the two items you called out are, in fact, aliases for another field, it may be that the underlying field to the alias is the problem.

You may also have a second problem, OR it might be related to the first one. You have three tables in your query with one relationship directly from the 1st to the 3rd table, but the other relationship goes through the 2nd table. This means that you have an ambiguous path from beginning to end for that relationship, and that can confuse Access. So I can't guarantee you that the error of the missing data isn't due to this ambiguous path.
But after query, the returned result is true??
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:36
Joined
May 7, 2009
Messages
19,247
check the query and report.
 

Attachments

  • Total.accdb
    3.4 MB · Views: 179

GaDauBac

Member
Local time
Today, 14:36
Joined
Mar 22, 2021
Messages
42
check the query and report.
Hello!
After I edited the Query it failed again please review it for me and tell me why it failed.
Now Query does not group ?
Thank you!
 

Attachments

  • Total.accdb
    3.4 MB · Views: 173
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:36
Joined
May 7, 2009
Messages
19,247
see your query.
 

Attachments

  • Total (1).accdb
    3.4 MB · Views: 145

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:36
Joined
May 7, 2009
Messages
19,247
see the query, the answer is in there.
 

GaDauBac

Member
Local time
Today, 14:36
Joined
Mar 22, 2021
Messages
42
see the query, the answer is in there.
Hi!
I see when the Query query returns the results as shown, I want to group SHD 14, 15, 16 (which is 2 items but only in 1 invoice)
Please help me check. Thanks!
Capture.JPG
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:36
Joined
May 7, 2009
Messages
19,247
they have 2 records in tb2_ChiTietHopDong table?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:36
Joined
May 7, 2009
Messages
19,247
on your query (qr_Dt-CN) ThanhTien is being used from table tb2_ChiTietHopDong.
do you need to Sum() the 2 records of same invoice?
 

GaDauBac

Member
Local time
Today, 14:36
Joined
Mar 22, 2021
Messages
42
Yes! that's exactly it, thank you for understanding
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:36
Joined
May 7, 2009
Messages
19,247
here i made another query and use it in replacement of table tb2_ChiTietHopDong.
 

Attachments

  • Total (1).accdb
    3.5 MB · Views: 176

Users who are viewing this thread

Top Bottom