I am using a VB6 App to query an ACCESS 97 database.
I would like to use two of the database fields to perform a calculation. The answer, a percentage, is then stored in an alias named 'LOSS'.
However, when I attempt to use the new alias LOSS in the ORDER BY section of my query, it does not work.The query produces the correct results but does not place them in the desired order.
My query is shown below. Somebody PLEASE Help!!!!!!!!!
querystring = "select top 10 CLOSE,OPEN,LEGEND,(CLOSE/(OPEN/100))-100 as LOSS from PRICEDATA where DATE between # " & querydate & "# and # " & querydate1 & "# order by (CLOSE/(OPEN/100))-100 as LOSS desc"
I would like to use two of the database fields to perform a calculation. The answer, a percentage, is then stored in an alias named 'LOSS'.
However, when I attempt to use the new alias LOSS in the ORDER BY section of my query, it does not work.The query produces the correct results but does not place them in the desired order.
My query is shown below. Somebody PLEASE Help!!!!!!!!!
querystring = "select top 10 CLOSE,OPEN,LEGEND,(CLOSE/(OPEN/100))-100 as LOSS from PRICEDATA where DATE between # " & querydate & "# and # " & querydate1 & "# order by (CLOSE/(OPEN/100))-100 as LOSS desc"