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

Data won't display a negative value

heybro posted 2 years ago in General
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.
kalvaro posted 2 years ago
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?
kalvaro posted 2 years ago
Additionally, if you run this before importing data:

SET @@SESSION.sql_mode='TRADITIONAL';



... you should get error messages instead of bogus insertions.
heybro posted 2 years ago
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
heybro posted 2 years ago
@Kalvaro - sorry (very new to this) how do I do that?

heybro posted 2 years ago
I seem to have got it to work, ticking "unsigned" did the tricksmilehappy
kalvaro posted 2 years ago
Sure. What you did think "unsigned" meant? xD

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