I've run into a bit of a problem, I'm querying a filemaker database via ODBC from Python and I'm having an issue with fields that contain multiple values.
for example, in filemaker the field shows:
'5.2976e+17'
but when i click into it it shows the data I need:
529763
576932
516528
problem is SQL brings back the first example. And this causes a problem when I'm trying to search for these number I'm not getting a match.
When the numbers have been added to the field they have been added with a ¶ at the end of each line.
The Field is set as 'Number' and options are 'Indexed'
Any ideas why it's doing this?
Thanks!
Richard
On the layout you are using for ODBC, select the fields in question and change the data formatting options in the Inspector to ‘As entered’
I think, the problem is that your field is set as FileMaker data type "number". Change it into data type "text" in the field preferences
Related
We have a legacy vb6 solution working with an access database with one of the forms containing a number of mutually exclusive option buttons
There is no reference table and the options are saved/loaded using hard coding ie. values in the field optState would be either 0, 1 or 2.
We are building a query in Access to export data into XML and looking for a way to convert the options into text fields without updating the DB or VB application!. So if 0 show some text, 1 some other text ... etc.
Is there a way we can do this in the access query or access sql?
No plans to upgrade the VB or DB so looking for a workaround.
thanks
jay
You could use IIf (Immediate If) to do this in a query. As you have multiple values per field, you would need to nest them. Something like:
SELECT tblStatus.*,
IIf([Status]=0,"Available",IIf([Status]=1,"Sold",IIf([Status]=2,"Withdrawn",""))) AS StatusOut
FROM tblStatus;
This returns an empty string if a value is not 0/1/2. Or you could use Switch in the query:
SELECT tblStatus.*,
Switch([Status]=0,"Available",[Status]=1,"Sold",[Status]=2,"Withdrawn") AS StatusOut
FROM tblStatus;
Regards,
I have a really old database (created in 2002) where I need to select the unique values and copy them to another table.. unfortunately the select distinct is not working on the field.
There comes always the error that the field is too small to add the data.
As I have seen is there a restriction to the length of the fields. The column is set to long text. Do you have something like a workaround / solution how to solve it fast?
I have also tried to change the database to accdb from mdb without success.. still the same error.
Each field has 318 characters. I have like 5000 rows.
Thanks in advance!
The column is set to long text.
This is well known issue...
This should help: MS Access: "The field is too small to accept the amount of data you attempted to add" error when running a query
For further details, please see: The Memo data type is now called “Long Text”
From my VB.net application I manage to create a database.
I can also create tables, with all kinds of datatypes in them. (with much thanks to stackoverflow's contributors!)
so far so good...
but how do I set the datatype MEMO to accept rich text?
basically how do I code to get : (MS Access snippet)
I'm sure it is a simple addition to the regular CREATE TABLE business - but I don't know what!
any hints would be most appreciated!
You don't have to do anything to make the Memo data type accept RTF data. RTF is text and a Memo column stores text. Job done. Many of those fields you're setting on the column are about how Access DISPLAYS the data within Access itself, not how it stores it. If you're using the MDB or ACCDB file simply as storage and the data only gets displayed in your application then that Text Format is irrelevant.
I am working on IBM I series VR7, and running SQL(DB2) using CLLE.
I have a SQL procedure in a TXT file, having below command to create a table in QTEMP.
create table qtemp.FILE1 as (
select
Field1,Field2,Field3,.....Field10 from FILE2 ) with data;
I am calling the above procedure from CLLE using below command.
RUNSQLSTM SRCFILE(MyLib/MySrc) SRCMBR(Proc_txt) COMMIT(*NONE)
And then running below command to generate the spool.
RUNQRY QRYFILE((FILE1)) OUTTYPE(*PRINTER) OUTFORM(*DETAIL) FORMSIZE(60 132)
FORMTYPE(*STD) COPIES(1) LINESPACE(1)
The issue I am facing is that I am getting 2 white spaces between columns while creating the table using the create table command. When that table is converted into a spool file using above RUNQRY command, the fields on the right side truncates as my report width is 132 by default and I can not change it.
If the white spaces in the table created can be reduced to 1, my issue will be resolved.
The SQL I am using IBM i Series' default and DB2 as database. I don't have much idea about their version.
Edit2: Another issue I had was of report having a field in second line. Actually as per requirement a field had to be in the second row under another field. For example I needed field10 under field5. I have fixed it too, read my answer below.
Hope it helps people in need but I really doubt.
Edit1: I have updated the question as requested. Any help would be much appreciated. Thanks.
The short answer is that yes you can define the report to have 1 space between columns, but you have to define the Query400 object to do that. Unfortunately this is not a good place to write a tutorial for Query400. I can get you started though.
Type wrkqry, press enter.
Then put the cursor on the query name field, and press F4. You are now in the tool. You need to create a new query, and define everything about it in this tool. Play around with it, and see if that helps you.
I was able to get what I needed. As others have suggested, I have finally used WRKQRY to control the column spacing. Reduced the column spacing to 1 and was able to get the columns needed in the 132 width.
Another issue I had was of report having a field in second line. Actually as per requirement a field had to be in the second row under another field. For example I needed field10 under field5. So what I did was, I used the Line wrapping feature available in WRKQRY.
How I did:
Create a WRKQRY object and select the file needed.
Sequenced the field I needed in second line, to the bottom.
Go to Select Output Type and Output Form and take Y on Line Wrapping field. Put the
wrapping width equal to your report width. Leave other fields as required.
This way each record will have 10th field in next row, if it has data. You can add as
many as fields.
You may have to add some white spaces to the field for proper alignment. I would
suggest to create a new field and use concat(||) operator available in WRKQRY.
Thanks everyone for helping.
I am creating an InfoPath form and want to retrieve the data from the SQL database. I'm not looking for end users to fill in blank text fields, but rather am just wanting to populate the fields with the data from the SQL Database.
I have searched on some blogs and InfoPath/Microsoft sites to see how this can be accomplished, but many of the things I keep bumping into show how to create fields that the end user can populate instead of fields that are pre-populated.
I have already connected the database that I want to use to InfoPath and 'myfields' are already populated with the table that I am using, so half the battle has been won! :)
How can I accomplish this?
There are a few options available to you...
Firstly, you can look at using rules on the form load or default vlues in your InfoPath forms' fields to populate the fields with data from your SQL (secondary) data source... Take a look at this link here: http://social.technet.microsoft.com/Forums/en/sharepoint2010customization/thread/cb15a237-28cc-4d6b-8225-83181a7497ff
Secondly, you could use managed code on the form load to query the SQL database and then set your returned values to the values held in your fields in your InfoPath form. Take a look here for using managed code to do this: http://vspug.com/ssa/2006/01/03/populating-infopath-fields-with-sql-data-using-managed-code/
I hope this helps...