surah79
asked on
Access Query
Hi Guys
I am trying to write a query which can provide me Monthly Total depends on the user input date and year to date total also in the same query.
My table has the fields : Application Id, Status, Date.
My query should give an out put
Total Record In Oct-13 = 10
YTD Record Till Oct-13 = 50 (will Add all from Jan-13 -Oct-13)
I am trying to write a query which can provide me Monthly Total depends on the user input date and year to date total also in the same query.
My table has the fields : Application Id, Status, Date.
My query should give an out put
Total Record In Oct-13 = 10
YTD Record Till Oct-13 = 50 (will Add all from Jan-13 -Oct-13)
ASKER
Hi Fyed,
Its giving me an error function has wrong number of arguments.
Its giving me an error function has wrong number of arguments.
SELECT Sum(iif(Format([ Decision Date]), "mmyy") = [YourDate], 1, 0) as MonthCount,
Sum(iif(Format([Decision Date]), "yy") = Right([YourDate], 2), 1, 0) as YearCount
FROM Application
where status = 3;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT Sum(iif(Format([Date]), "mmyy") = [YourDate], 1, 0) as MonthCount,
Sum(iif(Format([Date]), "yy") = Right([YourDate], 2), 1, 0) as YearCount
FROM YourTable