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 |
|
TM2
Starting Member
4 Posts |
Posted - 2007-08-03 : 18:15:27
|
| Can someone help with this? Let me know if what I'm trying to do is possible... Here's code example: @ClientID int,@QuoteID int,@Base real,@One real,@DwellingLimit realASBEGINInsert Into tblOne(ClientID,QuoteID,GuideID,GuideRate,GuideMult,Premium) Select @ClientID, @QuoteID, GuideID,GuideRate, @+"GuideMult"+,GuideRate*GuideMultFrom tblTwo Where Choose = 'True';END I need the value stored in tblTwo.GuideMult (ie. One, BaseRate) to be translatedinto the numerical value shown on a webform (ie. @One, @BaseRate) and theninsert the numerical values into tblOne.GuideMult Clear as mud? Does somebody have a better way to do this? |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-08-03 : 18:19:50
|
| Can you show with some sample data what you are trying to do..Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
TM2
Starting Member
4 Posts |
Posted - 2007-08-03 : 18:33:20
|
| tblTwo has data like this:Row# - GuideRate - GuideMult1 .10 Base2 .20 Base3 .15 OneOn a web form:@Base is the result of a calculation based on entered data@One is the result of another calculation based on same entered dataI want to store the calculated numerical value in tblOne.GuideMult. |
 |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-08-03 : 18:41:59
|
| Sorry, I dont think I still understand your question. (1) What is the value that comes via the parameters(2) How do you want to split the values in parameters into the tableDinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
TM2
Starting Member
4 Posts |
Posted - 2007-08-03 : 19:32:01
|
| The spacing was messed up on posting the last...OK, let me try again.tblTwo holds a list of options a user can choose from.For each option chosen, a formula will calculate: GuideRate * GuideMultGuideRate is a real datatypeGuideMult is a varchar datatype GuideMult will contain one of three values: One, Base, or LimitOn a web form, the controls (@One, @Base, @Limit) contain the result of different calculations based on entered data.How can I retrieve the calculated values (@One,@Base,@Limit) to store in tblOne as real datatypes?Does this help? |
 |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-08-03 : 19:37:08
|
| So only one of the three @One, @Base, @Limit will have values? and you need to figure out which one has the value? or do you need to concatenate all three values into one?Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
TM2
Starting Member
4 Posts |
Posted - 2007-08-03 : 20:06:14
|
| If Option #1 in tblTwo has been chosen,GuideRate has value of 0.10and GuideMult has value of "Base"Based on the web form calculations,@One may contain 10.00@Base may contain 25.83@Limit may contain 40.00I want to insert into tblOne.GuideRate (0.10) and into tblOne.GuideMult (25.83) so that I can calculatetblOne.Premium (GuideRate*GuideMult = 0.10*25.83) then final value of (2.583)I want to be able to use & store whatever numerical value corresponds to tblTwo.GuideMult Is there a way to modify (punctuation-wise) the "SELECT" statement in the first post to accomplish this? |
 |
|
|
|
|
|
|
|