Hello,
I am needing to take the average of a column for the dates that I specify and return the number. See example below.
filelength is data type int and is in seconds in the database.
master_index is the table in the database.
filedatetime is data type (I didn't do this) nvarchar in the database and looks like this "2006-06-01 00:00:00.000" (I did not do this either).
The Select Statement is below or what I have so far.
select cast(sum(filelength) as float) / 60 as ColAvg from master_index where filedatetime between '"&StartDate&" 00:00:00.000' and '"&EndDate&" 23:00:00.000'"
I want to know on average the filelength over a specified date range that I specify with "StartDate" and "EndDate". I already have the code for doing that and outputing the results but I need to know how to get the calculations correct so that I output the one number that is the average.
I hope this makes sense and please feel free to ask me if it doesn't.
Any help is greatly appreciated and thanks in advance.
Thank you,
Ace
I am needing to take the average of a column for the dates that I specify and return the number. See example below.
filelength is data type int and is in seconds in the database.
master_index is the table in the database.
filedatetime is data type (I didn't do this) nvarchar in the database and looks like this "2006-06-01 00:00:00.000" (I did not do this either).
The Select Statement is below or what I have so far.
select cast(sum(filelength) as float) / 60 as ColAvg from master_index where filedatetime between '"&StartDate&" 00:00:00.000' and '"&EndDate&" 23:00:00.000'"
I want to know on average the filelength over a specified date range that I specify with "StartDate" and "EndDate". I already have the code for doing that and outputing the results but I need to know how to get the calculations correct so that I output the one number that is the average.
I hope this makes sense and please feel free to ask me if it doesn't.
Any help is greatly appreciated and thanks in advance.
Thank you,
Ace