I feel like a complete idiot. I used to be able to write simple queries but I haven't had much practice lately and now it seems I've completely forgotten how. If you type SELECT 100/20 in a query window it will return "5" (try it for yourself), and in that same vein I want to run SELECT Count1/Count2, meaning I have two Count(*) queries. Here's the first one:
This returns for me a count of 3251. Works fine. The second count is this (it also works fine),
Now how do I divide Count1/Count2 ??? I was hoping to do it all in one query and can't figure out how to get the division worked in. I tried using the slashmark to divide Count1/Count2 like this:
but I get the error: "Query input must contain at least one table or query."
Code:
(Select COUNT(*) as TotalDownloaded FROM FilesToDownload WHERE Jobname LIKE 'Optum*')
This returns for me a count of 3251. Works fine. The second count is this (it also works fine),
Code:
(
SELECT COUNT(*) AS NumDays FROM
(
SELECT DISTINCT DepositDate FROM FilesToDownload WHERE JobName LIKE 'Optum*'
)
)
Now how do I divide Count1/Count2 ??? I was hoping to do it all in one query and can't figure out how to get the division worked in. I tried using the slashmark to divide Count1/Count2 like this:
Code:
SELECT
(Select COUNT(*) as TotalDownloaded FROM FilesToDownload WHERE Jobname LIKE 'Optum*')
/
(
SELECT COUNT(*) AS NumDays FROM
(
SELECT DISTINCT DepositDate FROM FilesToDownload WHERE JobName LIKE 'Optum*'
)
)