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 |
|
ConfusedAgain
Yak Posting Veteran
82 Posts |
Posted - 2010-09-27 : 09:37:38
|
| What is the easy way to get the total cost?I have a field that records a length of time as nVarChar that is formatted hh:mm:ssI have a money value field that holds the price per minute.So for example Time 01:30:30*Money £0.60Total Price = £54.30Please tell me there is a smplie way to do this? |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2010-09-27 : 11:08:55
|
| declare @date datetimedeclare @price moneyset @price = $0.60set @date = '01:30:30'select datediff(ss,0,@date) * @price /60JimEveryday I learn something that somebody else already knew |
 |
|
|
|
|
|