Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

in a jam with SQL and division

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
Hey everyone, I have a situation here...i'm creating a form in coldfusion using SQL, and I used Access97 to create the DB...what I need to do is take 2 table's from the DB and divide them (divide one form into the other) and display the result of that, on a page...
I thought of using SQL with something like this:

select ten_days, answers, (ten_days/answers)
from forms


Will something like that work?? Is there another way to make this happen?? Simply put, I just want the table ten_days to divide into table answers...and since i'm using CF, its kinda hard to change the querries because CF puts in code i've never seen before...
In advance, thanx... I have not failed; I merely found 100,000 different ways of not succeding...
 
I don't know cold fusion. If it's "normal" SQL syntax, then

select [tbl1Name].[ten_days], [tbl2.name].[answers], from
[tbl1Name].[ten_days]/ [tbl2.name].[answers] AS [NewField] FROM......etc

Don't forget your join statements if your using more than one table.

 
Databaseguy, the problem is that CF uses alot of strange SQL coding syntax that i'm not familiar with...I tried to see if Acess can allow me to do the calculation, and in a way it does, but then I don't know how to display that answer to the page... I have not failed; I merely found 100,000 different ways of not succeding...
 
DatabaseGuy, thanx for the help...are you aware of anyother way that I can acheive this?? I have not failed; I merely found 100,000 different ways of not succeding...
 
Guju,

Did you try going to the CF forum? Terry M. Hoey
 
Hi th3856, actually we already fixed that problem...me and my co-worker realized we could use the <CFSET> parametere to list calculations...
Thanx for the reply though... I have not failed; I merely found 100,000 different ways of not succeding...
 
Guju, if you can, please post your fix. It may help someone else down the road... Terry M. Hoey
 
Sure thing th3856, alwayz glad to help...

<td width=&quot;240&quot; height=&quot;30&quot;><CFSET name_of_value = DetailField7 / DetailField5 * 100>#name_of_value#</td>

Hope this helps anyone else...
I have not failed; I merely found 100,000 different ways of not succeding...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top