User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 456,564 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,567 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 1062 | Replies: 2
Reply
Join Date: Oct 2007
Posts: 1
Reputation: clear1140 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
clear1140 clear1140 is offline Offline
Newbie Poster

retrieving a string into mathematical expression

  #1  
Oct 25th, 2007
Is it somehow possible to retrieve a string and then convert it into a mathematical expression? for example i have this string '14200 * 5' and then i want to convert this into a mathematical formula so that i could get the result of it which is 71000.. .. i thought eval() function was available on MSSQL , is there such a function on MSSQL?

Thanks....
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2007
Location: KSA
Posts: 147
Reputation: kb.net is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 26
kb.net's Avatar
kb.net kb.net is offline Offline
Junior Poster

Re: retrieving a string into mathematical expression

  #2  
Nov 1st, 2007
Hi,

You have to use the EXEC function but after some conc. ex:

EXEC('select ' + '14200 * 5')
you may need to use stored procedures.
It is never about the number of languages you know, you either have the logic of programming or you don't ...

Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 252
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 14
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: retrieving a string into mathematical expression

  #3  
Nov 8th, 2007
stored procedures is the solution here
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS SQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 5:47 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC