SQL Select returns only the First Letter of the result.

In my reports i’ve created a custom field. In that field i’m using a basic sql lookup statement. It’s only returning the first letter/number of the field.

SELECT
   CompanyFax
FROM
   company_info

Returns 2

But the same statement in the SQL builder or PHPMYADMIN returns the entire phone number.

Look into the properties of your custom field. I think that the length specification is not correct.

That was the first thing i thought as well. Either i’m being a goof, or that just isn’t an option for the field.

Jh4oFZj.png

@enuro12 : in you example you select “CompanyFax”, in your hardcopy you select “CompanyCounty” …It’s that the problem?

Sorry I was just getting a quick screen shot showing the lack of field length options.

In the second example, it only shows the FIRST letter of the County as well.

Ok, please show your field settings for field “CompanyFax”.

Here is the CompanyFax Field.
The difference between the two was me trying to change the sub field option to auto lookup. Both result in the same single character from the db displaying.

OQf9VYv.png

Maybe you need set to SQL clause where.

SELECT
CompanyFax
FROM
company_info
WHERE your_field = {YOUR_FIELD}

@enuro12 can you post a screenshot to the output of your application!? the place that show only 1 char? also please mention which version you are using 8.017 or 018?

I just figured out something else interesting. If i add a field to the SQL statement, it returns both values in full. But one is randomly placed on the pdf. Obviously i only need 1 field at a time, but interesting. Also the ‘CompanyName’ appears randomly, rather than being where the ‘CompanyFax’ is. Being the first returned result i’d expect it to be in the fax field, and the fax number to appear randomly.

SELECT
   CompanyName,
   CompanyFax
FROM
   company_info

results

@mikeDE
Here is the output.

The version is 7.01

@alvagar if i needed a where clause, i wouldn’t get any data at all. Not just the first character of the data string.

aNwViD2.png

0gzsxbs.png