Announcement

Collapse
No announcement yet.

SQL Select returns only the First Letter of the result.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

    Code:
    SELECT
       CompanyFax
    FROM
       company_info
    Returns 2

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

  • #2
    Look into the properties of your custom field. I think that the length specification is not correct.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      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

      Comment


      • #4
        @enuro12 : in you example you select "CompanyFax", in your hardcopy you select "CompanyCounty" ...It's that the problem?
        Best regards: - Reinhard -

        I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

        Comment


        • #5
          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.

          Comment


          • #6
            Ok, please show your field settings for field "CompanyFax".
            Best regards: - Reinhard -

            I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

            Comment


            • #7
              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

              Comment


              • #8
                Maybe you need set to SQL clause where.

                SELECT
                CompanyFax
                FROM
                company_info
                WHERE your_field = {YOUR_FIELD}

                Comment


                • #9
                  @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?

                  Comment


                  • #10
                    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.

                    Code:
                    SELECT
                       CompanyName,
                       CompanyFax
                    FROM
                       company_info
                    results
                    0gzsxbs.png


                    @mikeDE
                    Here is the output.
                    aNwViD2.png

                    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.

                    Comment

                    Working...
                    X