i have this query. i have tried to set the formats in design view but cannot get the PERCENTAGE column to display decimal values...SELECT T_vineyardblockdata.cultivars AS cultivars, Count(T_vineyardblockdata.cultivars) AS Total, Q_countTotalsvineyardblock.countblocks AS summation, [Total]*100\[summation] AS Percentage FROM T_vineyardblockdata, Q_countTotalsvineyardblock GROUP BY T_vineyardblockdata.cultivars, Q_countTotalsvineyardblock.countblocks;
Example: Total = 10; summation = 3 then Percentage = 3.33 but with my sql this Percentage = 3
any ideas?
Last edited by st0kvis; 09-22-2011 at 03:48 AM. Reason: problem solved
You could use Access's Format function:
SELECT T_vineyardblockdata.cultivars AS cultivars, Count(T_vineyardblockdata.cultivars) AS Total, Q_countTotalsvineyardblock.countblocks AS summation, Format([Total]*100\[summation],"0.00") AS Percentage FROM T_vineyardblockdata, Q_countTotalsvineyardblock GROUP BY T_vineyardblockdata.cultivars, Q_countTotalsvineyardblock.countblocks;
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
Hey dave, thanks for your response, now i get 3.00 instead of 3.33
Given your formula, I'd expect 333.33. I don't know why this just occured to me, but instead of using "0.00" you could just use "Percentage", I think.
Where are you reviewing your results? If in a table, check that the data type is double instead of integer.
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
got it the \(modulus) should be a /(division) ! i have hit a new level of noobness!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks