Question Query is Dropping the beginning parts of a field (1 Viewer)

Varzoth

New member
Local time
Today, 05:13
Joined
Nov 8, 2019
Messages
8
I'm trying to write a query that grabs data from a few tables to display in a report. But for some reason, the test in one of my fields is getting mangled it's just outputting some of the end of the field. I think it must be something to do with it being "select Distinct", because without the distinct I get the full field . . But not the result I want.:banghead:

Any advice would be greatly appreciated, It's driving me up the wall, someone else designed this database before I joined the company and everything is janky as hell ^^

for example this load of text:

Sampling with job change to 3059 the 750ml Tomotin on section 7 once warmed up issues were "crossed" joints at shoulder, repeat from sample one, CBON's possibly from the crossed shoulder/neck joint as sample one, bore over size repeat from sample one, sunk panels repeat from sample one, thin shoulder repeat from sample one. Issued with T2 B plug as per sample request, removed and checked to drawing, drawing is 20.20 reduced root to 18.90 and added a 6 deg side angle. Enabled bore control but "dipped finish" issue. This requires a full bore and plug and guide plate review for options, some samples "shelled" on top surface of ring. AM has requested looking at the plug and top surface being in the plug, see accompanying pictures. Glass thickness improved however still remains consistently close to minimum glass thickness. Review distribution and blank profile. Not sure how or what type of hollow scrape has been added but the bottle in the lower quarter has an obvious bump, A Minto reviewed mould and this "bump" is evident in the mould suggesting incorrectly profiled hollow scrape in the panel. This job as previously mentioned must have its own wiper fingers and stacker bar


Is being cropped to just this:
ump" is evident in the mould suggesting incorrectly profiled hollow scrape in the panel. This job as previously mentioned must have its own wiper fingers and stacker bar

This is the Query:
SELECT Distinct dbo_PRODUCTION_SAMPLE_REPORT.ID, dbo_PRODUCTION_SAMPLE_REPORT.JOB_No, dbo_PRODUCTION_SAMPLE_REPORT.SAMPLE_No, dbo_NPD_Container.ProjectTitle, dbo_NPD_CustContact.CustomerName, dbo_PRODUCTION_SAMPLE_REPORT.SAMPLE_DATE, dbo_PRODUCTION_SAMPLE_REPORT.MACHINE, dbo_PRODUCTION_SAMPLE_REPORT.EQUIPMENT, dbo_PRODUCTION_SAMPLE_REPORT.OPERATOR, dbo_PRODUCTION_SAMPLE_REPORT.SAMPLE_TIME, dbo_PRODUCTION_SAMPLE_REPORT.COSTED_SPEED, dbo_PRODUCTION_SAMPLE_REPORT.ACTUAL_SPEED, dbo_PRODUCTION_SAMPLE_REPORT.COSTED_EFFICIENCY, dbo_PRODUCTION_SAMPLE_REPORT.POSSIBLE_EFFICIENCY, dbo_PRODUCTION_SAMPLE_REPORT.HOT_INSPECT_01, dbo_PRODUCTION_SAMPLE_REPORT.HOT_INSPECT_02, dbo_PRODUCTION_SAMPLE_REPORT.HOT_INSPECT_03, dbo_PRODUCTION_SAMPLE_REPORT.HOT_INSPECT_04, dbo_PRODUCTION_SAMPLE_REPORT.HOT_INSPECT_05, dbo_PRODUCTION_SAMPLE_REPORT.HOT_INSPECT_06, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_01, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_02, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_03, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_04, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_05, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_06, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_07, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_08, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_09, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_10, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_11, dbo_PRODUCTION_SAMPLE_REPORT.COLD_INSPECT_12, dbo_PRODUCTION_SAMPLE_REPORT.EQUIPMENT_NOTES, dbo_PRODUCTION_SAMPLE_REPORT.FOREHEARTH_ZONE_1, dbo_PRODUCTION_SAMPLE_REPORT.FOREHEARTH_ZONE_2, dbo_PRODUCTION_SAMPLE_REPORT.FOREHEARTH_ZONE_3, dbo_PRODUCTION_SAMPLE_REPORT.FOREHEARTH_ZONE_4, dbo_PRODUCTION_SAMPLE_REPORT.GOB_OPTIC_INNER, dbo_PRODUCTION_SAMPLE_REPORT.GOB_OPTIC_CENTRE, dbo_PRODUCTION_SAMPLE_REPORT.GOB_OPTIC_OUTER, dbo_PRODUCTION_SAMPLE_REPORT.TEMP_NOTES, dbo_PRODUCTION_SAMPLE_REPORT.PRE_SAMPLE_COMMENTS, dbo_PRODUCTION_SAMPLE_REPORT.COMMENTS, dbo_PRODUCTION_SAMPLE_REPORT.COLD_END_COMMENTS, dbo_PRODUCTION_SAMPLE_REPORT.SAMPLE_LEADER, dbo_PRODUCTION_SAMPLE_REPORT.BAFFLE_CAVITY_TEMP, dbo_PRODUCTION_SAMPLE_REPORT.BLANK_HEEL_TEMP, dbo_PRODUCTION_SAMPLE_REPORT.BLANK_BODY_TEMP, dbo_PRODUCTION_SAMPLE_REPORT.BLANK_SHOULDER_TEMP, dbo_PRODUCTION_SAMPLE_REPORT.NECK_RING_TEMP, dbo_PRODUCTION_SAMPLE_REPORT.PLUG_TEMP, dbo_PRODUCTION_SAMPLE_REPORT.FUNNEL_SETUP, dbo_PRODUCTION_SAMPLE_REPORT.MOULD_SHOULDER_TEMP, dbo_PRODUCTION_SAMPLE_REPORT.MOULD_BODY_TEMP, dbo_PRODUCTION_SAMPLE_REPORT.MOULD_HEEL_TEMP, dbo_PRODUCTION_SAMPLE_REPORT.MOULD_BOTTOM_TEMP, dbo_PRODUCTION_SAMPLE_REPORT.LOGGED_USER, dbo_PRODUCTION_SAMPLE_REPORT.LOGGED, dbo_PRODUCTION_SAMPLE_REPORT.SECTION, dbo_PRODUCTION_SAMPLE_REPORT.SAMPLE_RESULT, dbo_RingCodeList.Description, dbo_NPD_SampleRequest.ID
FROM (dbo_NPD_SampleRequest INNER JOIN (dbo_PRODUCTION_SAMPLE_REPORT INNER JOIN (dbo_NPD_CustContact RIGHT JOIN dbo_NPD_Container ON dbo_NPD_CustContact.PENumber = dbo_NPD_Container.PENumber) ON dbo_PRODUCTION_SAMPLE_REPORT.JOB_No = dbo_NPD_Container.JobNumber) ON (dbo_NPD_SampleRequest.JobNumber = dbo_PRODUCTION_SAMPLE_REPORT.JOB_No) AND (dbo_NPD_SampleRequest.TimesSampled = dbo_PRODUCTION_SAMPLE_REPORT.SAMPLE_No)) INNER JOIN dbo_RingCodeList ON dbo_NPD_SampleRequest.RingCode = dbo_RingCodeList.RingCode;
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:13
Joined
Oct 29, 2018
Messages
21,453
Hi. Welcome to AWF!



Unfortunately, this is probably because the field getting affected is a Long Text field, which is a side effect of using DISTINCT or GROUP BY in queries. Just as a test, see if the resulting text is limited (cutoff) to 255 characters.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 23:13
Joined
Feb 28, 2001
Messages
27,140
If it is going into a report text box, is the box set to "CAN GROW"?

Normally I would expect truncation at the top, but it is possible to control the placement of text to be bottom-oriented and that might have the indicated effect.
 

Cronk

Registered User.
Local time
Today, 14:13
Joined
Jul 4, 2013
Messages
2,771
Try creating a new query based on your current DISTINCT query without the long text fields and joined to the table with the long text field, selecting only that long text field.
 

Users who are viewing this thread

Top Bottom