distal-attribute
distal-attribute
distal-attribute
distal-attribute

Data won't display a negative value

User, date Message
Written by heybro
2 years ago
Category: General
4 posts since Wed, 13 Feb 13
Hi There,

I created a table to test importing some data from a CSV file (figured that out eventually) however I have a problem in a lot of my rows there are negative values, in some there are only negative values however, when I click the DATA tab next to query they are all shown only as 0.00 or 0 depending - I set these values to decimal but even attempting to manually insert still only gets the 0.

What's the go here - some quick looking on your forum shows me that this should have already been fixed or have I done something wrong?

I'm using the latest version on WINE.
Written by kalvaro
2 years ago
595 posts since Thu, 29 Nov 07
Seeing no sample data or CREATE TABLE statements it's difficult to say what's wrong. Are you sure that data fits in your column data type?
Written by kalvaro
2 years ago
595 posts since Thu, 29 Nov 07
Additionally, if you run this before importing data:

SET @@SESSION.sql_mode='TRADITIONAL';



... you should get error messages instead of bogus insertions.
Written by heybro
2 years ago
4 posts since Wed, 13 Feb 13
CREATE TABLE `Trades` (
`Provider Ticket` DECIMAL(10,10) UNSIGNED NULL DEFAULT NULL,
`Broker Ticket` INT(10) UNSIGNED NULL DEFAULT NULL,
`Type` TEXT NULL COLLATE 'utf8_general_mysql500_ci',
`Currency` TEXT NULL COLLATE 'utf8_general_mysql500_ci',
`Standard Lots` DECIMAL(10,1) UNSIGNED NULL DEFAULT NULL,
`Date Open` DATETIME NULL DEFAULT NULL,
`Date Close` DATETIME NULL DEFAULT NULL,
`Price Open` DECIMAL(10,5) UNSIGNED NULL DEFAULT NULL,
`Price Close` DECIMAL(10,5) UNSIGNED NULL DEFAULT NULL,
`Highest Profit (Pips)` DECIMAL(10,0) NULL DEFAULT NULL,
`Worst Drawdown (Pips)` DECIMAL(10,2) UNSIGNED NULL DEFAULT NULL,
`Interest` DECIMAL(10,2) UNSIGNED NULL DEFAULT NULL,
`Profit (pips)` DECIMAL(10,2) UNSIGNED NULL DEFAULT NULL,
`Profit ($)` DECIMAL(10,2) UNSIGNED NULL DEFAULT NULL
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

This is the data directly from CSV, tab spaced. I got a fair few error messages (64) for this data (an example of one row)

400.1307612679 3562997 BUY EUR/USD 0.1 2011/06/10 01:25:37 2011/06/14 07:08:13 1.4548 1.44644 2 -228 0.14 -83.6 -83.46
Written by heybro
2 years ago
4 posts since Wed, 13 Feb 13
@Kalvaro - sorry (very new to this) how do I do that?
Written by heybro
2 years ago
4 posts since Wed, 13 Feb 13
I seem to have got it to work, ticking "unsigned" did the tricksmilehappy
Written by kalvaro
2 years ago
595 posts since Thu, 29 Nov 07
Sure. What you did think "unsigned" meant? xD
 

Please login to leave a reply, or register at first.