Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 6 of 6 total |
Truncating an amount |
Mon, Apr 27 2009 12:33 AM | Permanent Link |
"Al Vas" | Hi,
As of V3 of DBISAM the TRUNCATE function is not available, so does anyone know what is the best way to obtain the whole portion of a number. I need to do this as I need to create my own ROUND routine as the standard round routine in V3 for some inexplicable reason rounds .5 up in some instances and down in others. Thanks Alex |
Mon, Apr 27 2009 3:44 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Al
Of the top of my head, and without remembering what functions are available in V3: 1. CAST(xxx AS INTEGER) 2. CAST(SUBSTR(CAST(xxx AS CHAR) ,1,POS(CAST(xxx AS CHAR),'.')-1) AS INTEGER) Roy Lambert |
Mon, Apr 27 2009 3:36 PM | Permanent Link |
"Jeff Cook" | Al Vas wrote:
> Hi, > > As of V3 of DBISAM the TRUNCATE function is not available, so does > anyone know what is the best way to obtain the whole portion of a > number. I need to do this as I need to create my own ROUND routine > as the standard round routine in V3 for some inexplicable reason > rounds .5 up in some instances and down in others. > > Thanks > > Alex Alex To de-inexplicable-ise it, sound like "Bankers Rounding" where even numbers round up and odd numbers round down - ? or is it the other way? Cheers Jeff -- Jeff Cook Aspect Systems Ltd www.aspect.co.nz + Joan and Jeff Cook The Cooks Oasis www.cookislandsoasis.com |
Tue, Apr 28 2009 9:57 AM | Permanent Link |
"Al Vas" | Hi Jeff,
Makes sense but this is the weird thing. I have two reports (ReportBuilder) where I've created a data definition (SQL statement) with the same calculated field (using ROUND) and they produce different results with the same data. I don't expect anyone to believe me Anyway I have used the CAST function to create my own rounding function (as per Roys advice) and it is a problem no longer. Alex "Jeff Cook" <jeffc@aspect.co.nz> wrote in message news:066CB18B-1D49-4A34-B2B6-7C5E532BCE44@news.elevatesoft.com... > Al Vas wrote: > >> Hi, >> >> As of V3 of DBISAM the TRUNCATE function is not available, so does >> anyone know what is the best way to obtain the whole portion of a >> number. I need to do this as I need to create my own ROUND routine >> as the standard round routine in V3 for some inexplicable reason >> rounds .5 up in some instances and down in others. >> >> Thanks >> >> Alex > > Alex > > To de-inexplicable-ise it, sound like "Bankers Rounding" where even > numbers round up and odd numbers round down - ? or is it the other way? > > Cheers > > Jeff > > -- > Jeff Cook > Aspect Systems Ltd > www.aspect.co.nz > + > Joan and Jeff Cook > The Cooks Oasis > www.cookislandsoasis.com |
Tue, Apr 28 2009 1:04 PM | Permanent Link |
"Malcolm" | Hi Alex
In your original post when you said sometimes it rounded up and others down, I assumed you were referring to 'bankers' rounding where the value is rounded to the nearest *even* whole number. Malcolm |
Wed, Apr 29 2009 2:32 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Alex,
<< Makes sense but this is the weird thing. I have two reports (ReportBuilder) where I've created a data definition (SQL statement) with the same calculated field (using ROUND) and they produce different results with the same data. I don't expect anyone to believe me >> Sometimes it may appear that way because you're not seeing the entire textual representation of a floating-point number. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, May 7, 2024 at 06:25 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |