Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread My "select" result is different from the BCD field in the DB.
Tue, Sep 11 2012 4:55 PMPermanent Link

Rafael

Hi,

There's a field in my DB which type is set do BCD. The value is 10,8 - This is the value I want.

But when i "Select" this same field in my website, the value changes to 4,2464.

I can't change the type of the BD field, so I need to convert it.

Can someone help me on how to do that? I'm using VBScript.

Thanks in advance.
Tue, Sep 11 2012 9:45 PMPermanent Link

Rafael

New observation:

Only values with comma get changed when i do a "select".

If the BCD-type field is 580, the "select" result is still 580.

If the BCD-type field is 10,8, the "select" result is 4,2464.
Wed, Sep 12 2012 4:00 PMPermanent Link

Raul

Team Elevate Team Elevate

Are you sure you're interpreting the BCD value correctly in whatever
code populates the website. If you access the table using DBSYS what
does it show?

Once thing i would try is to cast the BCD value as float for example and
see how that works:

something like

select cast(<BCDField>,Float) from <table>

Raul


On 9/11/2012 4:55 PM, Rafael wrote:
> There's a field in my DB which type is set do BCD. The value is 10,8 - This is the value I want.
>
> But when i "Select" this same field in my website, the value changes to 4,2464.
>
> I can't change the type of the BD field, so I need to convert it.
>
> Can someone help me on how to do that? I'm using VBScript.
>
> Thanks in advance.
Thu, Sep 20 2012 2:28 PMPermanent Link

Rafael

Thanks Raul!

I used "select cast(FIELD as money) as FIELD from TABLE..." and it worked fine!

Thanks a lot for your help!
Image