Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
rme8494
Yak Posting Veteran
98 Posts |
Posted - 2005-04-05 : 15:16:55
|
| The query below returns a value of 4 and I would like to get a value of 5.COUNT(Entry_ID) = 277COUNT(Entry_ID) / 60 = 4.6SELECT ROUND((COUNT(Entry_ID)/60),0) AS PageCountFROM eSRS_BilLDataWHERE Request_ID = 1Can someone help me here? I thought Round would work. I need anything over 4.0 to be displaed as 5 pages.RyanRyan EverhartSBCSBC. Going Beyond the Call! |
|
|
rfrancisco
Yak Posting Veteran
95 Posts |
Posted - 2005-04-05 : 15:30:40
|
| You should be using the ceiling function and not round. Your query will look like this:SELECT CEILING(COUNT(Entry_ID)/60.0) AS PageCountFROM eSRS_BilLDataWHERE Request_ID = 1Take note, I changed the 60 to 60.0 to make it decimal and not int. |
 |
|
|
rme8494
Yak Posting Veteran
98 Posts |
Posted - 2005-04-05 : 15:41:28
|
| That worked!!! Thank you very much! I tried ceiling but the 60.0 was the key!RyanRyan EverhartSBCSBC. Going Beyond the Call! |
 |
|
|
|
|
|