Let me try to explain my problem. I run a playlist automated script that uses a scripting language to run against a mySQL DB of songs. In my DB is the table "songlist" and a particular field of that table is floating variable called "balance".
I have several sql statements that successfully manipulate and write to this field. Typically the balance ends up less than zero as a decimal but my program only displays 6 places to the right of that decimal. Then I run the following queries.
D in this example is a data set which is a mysql database
I then set the value of balance to an in script floating variable low_balance
As a debug tool I can then write that low_balance variable to the screen to verify the contents of it.
Then I attempt to make a selection from the DB using this query
The only time this statement works (actually selects a filename) is when the actual calculated balance is 0.
When I debug this, as an example, I see that low_balance is = .896532 (or some similar figure, it could be 1.254389) and I have at least 100 records in my songlist with the identical value in the balance field but it never EQUATES low_balance and balance as equal eventhough low_blance was derived from balance as being set to equal it.
but, it always selects (or evaluates as true) when the balance is = 0.
I know this may be confusing but I thought I would give it a shot here
I have several sql statements that successfully manipulate and write to this field. Typically the balance ends up less than zero as a decimal but my program only displays 6 places to the right of that decimal. Then I run the following queries.
D in this example is a data set which is a mysql database
Code:
D := Query('Select balance from songlist where songtype = ''S'' Order by balance ASC',[], True);
I then set the value of balance to an in script floating variable low_balance
Code:
low_balance = D['balance']
As a debug tool I can then write that low_balance variable to the screen to verify the contents of it.
Then I attempt to make a selection from the DB using this query
Code:
D := Query('select filename from songlist where songtype = ''S'' and balance = :low_balance Order by RAND() LIMIT 1', [low_blance]);
The only time this statement works (actually selects a filename) is when the actual calculated balance is 0.
When I debug this, as an example, I see that low_balance is = .896532 (or some similar figure, it could be 1.254389) and I have at least 100 records in my songlist with the identical value in the balance field but it never EQUATES low_balance and balance as equal eventhough low_blance was derived from balance as being set to equal it.
but, it always selects (or evaluates as true) when the balance is = 0.
I know this may be confusing but I thought I would give it a shot here