thandel
asked on
Access 2003 Query not totalling simliar data
I am using the following query:
For the most part its pulling up data correctly but for some reason it is not grouping on the same model. Its not doing it for all models but just some times. I can't figure out why given its the same exact model.
Is there anyting in the SQL that might be causing this?
Thank you.
SELECT tMain.FrameLine, tMain.FrameModel, Count(tMain.FrameModel) AS CountOfFrameModel, tMain.FrameOWF
FROM tMain
WHERE (((tMain.Office)=[Forms]![FReportSelect]![LocSelect]) AND ((tMain.FrameLine)=[Forms]![FReportSelect]![cFrameLine]) AND ((tMain.FrameOWF)=False) AND ((tMain.Status)<>"Cancelled")) OR (((tMain.FrameLine)=[Forms]![FReportSelect]![cFrameLine]) AND ((tMain.FrameOWF)=False) AND ((tMain.Status)<>"Cancelled") AND (([Forms]![FReportSelect]![LocSelect])="ALL"))
GROUP BY tMain.FrameLine, tMain.FrameModel, tMain.FrameOWF, tMain.Status
ORDER BY tMain.FrameModel;
For the most part its pulling up data correctly but for some reason it is not grouping on the same model. Its not doing it for all models but just some times. I can't figure out why given its the same exact model.
Is there anyting in the SQL that might be causing this?
Thank you.
if you select DISTINCT models, do you get repeating rows that look similar?
You are also grouping by tMain.Status, but not displaying it... this would affect groupings
ASKER
Thanks
Coachman, using distinct didn't have any change in results
John, I set status to be displayed but didn't have any change in results either.
Coachman, using distinct didn't have any change in results
John, I set status to be displayed but didn't have any change in results either.
My reason for using DISTINCT was to identify the reason for multiple models.
if you select DISTINCT models, do you get repeating models that look similar?
only select models, no other fields, and see if there are multiple instances of similar models.
if you select DISTINCT models, do you get repeating models that look similar?
only select models, no other fields, and see if there are multiple instances of similar models.
ASKER
If I follow your question, when selecting distinct the results are multipul models on the report of the same exact model in the querry.
For example of the model "BOTTLE ROCKET 40" I am getting one row in the query with a countofframemodel of 1 and in another row with model "BOTTLE ROCKET 40" with a countofframemodel of 3.
They are both exactly the same model.
In the query I have some models with a count of 6 but are only on a single row.
For example of the model "BOTTLE ROCKET 40" I am getting one row in the query with a countofframemodel of 1 and in another row with model "BOTTLE ROCKET 40" with a countofframemodel of 3.
They are both exactly the same model.
In the query I have some models with a count of 6 but are only on a single row.
I dont understand what you are saying. The query I suggested had one field - model; no counts etc.
Maybe attach an xls with the results so I can see.
Maybe attach an xls with the results so I can see.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you, the valaues entered are trimmed. I would attach a query but now when I run the issue is gone?????
Not sure how to proceed now, or why is behaving differently. Odd, a repair is run daily... still seems OK this morning. What is the best way to close / issue points on this?
Not sure how to proceed now, or why is behaving differently. Odd, a repair is run daily... still seems OK this morning. What is the best way to close / issue points on this?