asp & sql question

# Thread: asp & sql question

1. Member
Join Date
Dec 1969
Posts
57

## asp & sql question

In asp script I have this tag:<BR><BR>g = "SELECT pogodaka, tipova, (pogodaka*100/tipova) as omjer FROM " & sstrDBO & "testna_tabela ORDER BY (pogodaka*100/tipova) DESC"<BR><BR>k.open g, ObjConn<BR><BR><BR>And there is results-list of this sql query:<BR><BR>10/14 71%<BR>8/15 53%<BR>7/13 53%<BR>16/30 53%<BR>4/13 30%<BR><BR>but 8/15 equals 53.33 and 7/13 equals 53.85! So, why list isn’t:<BR><BR>10/14 71%<BR>7/13 53%<BR>8/15 53%<BR>16/30 53%<BR>4/13 30%<BR><BR>How to solve that? How I can get correct list?

2. Senior Member
Join Date
Dec 1969
Posts
497

## RE: asp & sql question

Select Percentage=convert(float,pogodaka)/convert(float,tipova)*100<BR>gets kinda messy so i use...<BR>Select Percentage=convert(nvarchar,convert(float,convert( int,convert(float,pogodaka)/convert(float,tipova)*10000))/100)<BR><BR>something like that.... <BR>sponge<BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•