dbTalk Databases Forums  

modulus, truncate in oracle rdb

comp.databases.rdb comp.databases.rdb


Discuss modulus, truncate in oracle rdb in the comp.databases.rdb forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
karolina
 
Posts: n/a

Default modulus, truncate in oracle rdb - 04-29-2005 , 04:42 AM






Hi,

I have a column named period in my oracle rdb database. I now want to
convert the rows in that column like
period = (period + 9) / 10

Ex (100 + 9)/10 = 10,9 -> 10
(101+9)/10 = 11,0 -> 11

doing "...set period = (period+9)/10" (period = 10) will in oracle rdb
give me 2 but doing the exact same thing in C will give me 1 which is
what I want.

Is there any MOD(), TRUNC() etc functions that I could use or any
other way to get this right. I tried to do(-0.5) on my calculated
value do get it to round down bu it gets me other problems when fore
examle I want to convert 0(zero).
I also tried the CAST as integer function without success.

Thanks
Karolina

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.