When linking CSV files to MS Access 2007 I get some fields with #NUM!
Why do I get this?
I was thinking that it is probably because I have fields with the following numbers 9999999999 and the data type i use is _long Integer_, but how can I get the actual number?
Is it probably because I have fields with the following numbers 9999999999 the data type i use is long Integer
Yes. The largest positive value that will fit in a Long Integer column is
2,147,483,647
so
9,999,999,999
won't fit. You will either need to change the column type to
Field size: Decimal
Precision: 10
Scale: 0
or store the values as Text.
Related
I have value as such:
0.0252947874381181000000
I need to copy this value from excel spreadsheet into Access local table. The field type is Double, decimal places are set to Auto. I am getting the following message: The value you entered isn't valid for this field. What is wrong here?
What is wrong is simply, that Double can't handle that many decimals.
Change the data type to Decimal.
i was trying to create a money related app in which users can choose their currency. Mysql datatype i tried is decimal(19,4). Now the problem is few currencies need three precisions and some need two
Eg:
oman rial needs three precisions. ie 1000 baisa = 1 omani rial. Hence my customers may enter 6.783 omani rial.
Where as my US customers will need only 2 precisions as 100 cents = 1 dollar and they may enter 5.50.
When i insert these two entries to my database using decimal(19,4), it is saved as 6.7830 and 5.5000 respectively.
Now the real pain is when i need to display their entrys as i dont want to display that extra 0 in omani rial entry and that 00 in US dollar. I also tried float but last digit gets rounded off at times.
Is there any mysql data type in which i can save exact entry as it is without any rounding off or extra zeros? If there is no such entry, how can i make it ppssible?
You can use VARCHAR to store exact representations, but I don't recommend that because it takes more bytes to store a number as a string. And any arithmetic you do on the value will convert it to a number anyway.
I recommend you use DECIMAL(19,4), and then format the value in application code, to display it with the appropriate digits. Every programming language has some function like printf() that allows you to control the output formatting, regardless of the value stored.
I have imported data from MS Access (mdt) file to MS SQL. Now I would like to test that the long text was not truncated during the import. I calculated minimum, average, maximum and sum of lengths of texts in the resulting data, like this
SELECT
MIN(DATALENGTH([LongField]))
,AVG(DATALENGTH([LongField]))
,MAX(DATALENGTH([LongField]))
,SUM(DATALENGTH([LongField]))
FROM TheExportedTable
Results:
0 725 7574 2156708
I would like to check in MS Access that the original statistics on this field was the same. The type of the field in MS Access is memo. How can I do it? I tried adding a calculated field, it just did not work. When I tried adding a calculated field, nothing happened...
In Access you would use LEN instead of DATALENGTH:
SELECT
MIN(LEN([LongField]))
,AVG(LEN([LongField]))
,MAX(LEN([LongField]))
,SUM(LEN([LongField]))
FROM TheExportedTable
I'm trying to store price figures in my Access database and am using a Currency field (instead of Decimal) for reasons, including the fact I'm using an old version of Access that are detailed in this thread: Syntax error in PARAMETER clause when passing through parameters as Decimal types using MS Access querydefs.
For consistency between systems I need to store the prices to 6 decimal places. However regardless of the settings I choose in Access, the values I type in are automatically rounded to 4 decimal places.
Here is the field in the table setup to 8 decimal places (I need 6 but was trying more in case):
Here is the just entered, as yet unrounded figure:
And after I press return, the value saves to the table, but rounded to four dps:
Is there any way to get MS Access to store currency datatypes to more than 4 decimal places? Am I doing something wrong?
Many thanks,
Jamie
For anyone that has the same problem as me, I've solved it by using currency parameter types in the querydef and decimal fields in the table:
Decimal data type:
Currency param:
This gets over issues with the decimal param type (detailed here:Syntax error in PARAMETER clause when passing through parameters as Decimal types using MS Access querydefs) and issues with the currency field rounding to 4 dps http://msmvps.com/blogs/access/archive/2009/04/27/the-problems-with-currency-fields.aspx
Under a column that has a number data type. I am trying to enter the number 11.50, but the system is automatically changing it to 12.00.
because this type numbers can handle only numbers with out any fractions
you must change this datatype to be double
There are two settings for Number fields Field Size and Decimal Places. At first, you should change Field Size from Integer to either single, double.
When you have the table open in design mode, click on the field in question. In the lower pane you will see properties of the number, change the field size to either Single or Double.