Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] Default MySQL Amount Column Types



******    message to minivend-users from "Cameron B. Prince" <cbp@InternetExpertsLLC.com>     ******

Hi list,

I just ran into a problem where amounts weren't being calculated correctly
using queries like:

select sum(total_cost) from transactions

I finally tracked this to the column types defined in the transactions.mysql
as well as the other default databases.

The amount, extension, subtotal and total_cost fields are defined similar to
this:

Database  orderline  COLUMN_DEF   "subtotal=CHAR(12) NOT NULL"


When using SQL group functions, decimal places are being dropped due the
CHAR column type.

I fixed this by modifying each .mysql file that stores amounts like so:

Database  transactions  COLUMN_DEF   "total_cost=FLOAT(4) NOT NULL"



Is there some other reason I am missing for defining these this way
originally?


Thanks,

Cameron

-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: