If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Divide Problem, I want code doing no round for me

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-27-04, 03:53
boxturtle boxturtle is offline
Registered User
 
Join Date: May 2004
Location: CHINA Taiwan
Posts: 3
Divide Problem, I want code doing no round for me

well,
#---
define i decimal(4,1),
j smallint,
k smallint,

Let i = 172
Let j=i/60
Let k = i mod 60
#---
k has no problem here...

So, my j is going to be 3
But I wished it to be 2
this is a serious question when I make 172 minutes to be 2(j)hours and (k) minutes

I thinked a lot and there is no way out...
How to solve this, PLEASE.
Reply With Quote
  #2 (permalink)  
Old 07-27-04, 04:02
iaguigon iaguigon is offline
Registered User
 
Join Date: May 2004
Location: Barcelona, Spain
Posts: 54
two ways:

Let i = 172
Let j=TRUNC(i/60)
Let k = i mod 60


Let i = 172
Let k = i mod 60
Let j=(i-k)/60

cheers
Reply With Quote
  #3 (permalink)  
Old 07-27-04, 04:07
boxturtle boxturtle is offline
Registered User
 
Join Date: May 2004
Location: CHINA Taiwan
Posts: 3
Thank you, I watched your post finally found I asked a question I never thought that answer, my brain is slow....
I am a newbie and asked a newbie question.
I like the second way, so people may know what i want to explain.

Thanks again.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On