Hi,
Here's my problem:
Due to the Euro (a new currency in Europe) all prices must be displayed using decimal positions. The rate of the currency must be displayed using 4 decimal positions. I need this rate to recalculate the prices in my report.
I created a query with the Crystal SQL Designer which adds the rate to every record. This rate, however, only has 2 decimal positions. I've tried using the CAST-statement to alter the decimal positions, but without any success.
When using the rate in my report, all prices are calculated the wrong way, ex. all prices are divided by 40.34 instead of 40.3399. In know the difference is small, but it has to be exact.
Here's a part of my statement:
SELECT
a.firnr,
a.klanr,
a.naam AS KLANT,
a.vertnr,
b.naam AS VERT,
c.jaar,
c.periode,
c.saldo,
c.jnl,
c.faktnr,
c.facn,
c.datum,
c.bedragbf,
c.vervaldat,
c.vervalbedr,
CAST(c.bedragb AS VARCHAR(250)) AS bedragb,
CAST(c.datumb AS VARCHAR(250)) AS datumb,
CAST(c.koers AS NUMERIC(6,4)) AS koers
FROM
pub.kla a,
pub.vert b,
pub.opk c
WHERE
a.firnr = 1 AND
a.firnr = b.firnr AND
a.vertnr = b.vertnr AND
a.firnr = c.firnr AND
a.klanr = c.klanr
When executing this query in the SQL Explorer from Progress, the currency rate is exactly 40.3399.
Does anyone know how I can solve this problem. Any advice would be appreciated.
Thanx in advance,
Ilse
Here's my problem:
Due to the Euro (a new currency in Europe) all prices must be displayed using decimal positions. The rate of the currency must be displayed using 4 decimal positions. I need this rate to recalculate the prices in my report.
I created a query with the Crystal SQL Designer which adds the rate to every record. This rate, however, only has 2 decimal positions. I've tried using the CAST-statement to alter the decimal positions, but without any success.
When using the rate in my report, all prices are calculated the wrong way, ex. all prices are divided by 40.34 instead of 40.3399. In know the difference is small, but it has to be exact.
Here's a part of my statement:
SELECT
a.firnr,
a.klanr,
a.naam AS KLANT,
a.vertnr,
b.naam AS VERT,
c.jaar,
c.periode,
c.saldo,
c.jnl,
c.faktnr,
c.facn,
c.datum,
c.bedragbf,
c.vervaldat,
c.vervalbedr,
CAST(c.bedragb AS VARCHAR(250)) AS bedragb,
CAST(c.datumb AS VARCHAR(250)) AS datumb,
CAST(c.koers AS NUMERIC(6,4)) AS koers
FROM
pub.kla a,
pub.vert b,
pub.opk c
WHERE
a.firnr = 1 AND
a.firnr = b.firnr AND
a.vertnr = b.vertnr AND
a.firnr = c.firnr AND
a.klanr = c.klanr
When executing this query in the SQL Explorer from Progress, the currency rate is exactly 40.3399.
Does anyone know how I can solve this problem. Any advice would be appreciated.
Thanx in advance,
Ilse