Dov_B
asked on
how do I create a query that will sum the records of the past week in ms access 2003
how do I create a query that will sum the records of the past week in ms access 2003
by past week, what does it include, last week monday to Sunday?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I sum from sunday through thursday
how do I write the sql in msa access so its not hardcoded and does not need to be rewritten each week
how do I write the sql in msa access so its not hardcoded and does not need to be rewritten each week
for last monday and last friday dates as past week
select sum([FieldName])
from tableName
where [dateField] between Dateadd("d", - 6 - Weekday(Date, 2),date) and dateadd("d",-2-weekday(dat e,2),Date)
select sum([FieldName])
from tableName
where [dateField] between Dateadd("d", - 6 - Weekday(Date, 2),date) and dateadd("d",-2-weekday(dat
from sunday through thursday, use this
select sum([FieldName])
from tableName
where [dateField] between Dateadd("d", -7 - Weekday(Date, 2),date) and dateadd("d",-3-weekday(dat e,2),Date)
select sum([FieldName])
from tableName
where [dateField] between Dateadd("d", -7 - Weekday(Date, 2),date) and dateadd("d",-3-weekday(dat
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks you have beeen a great help!
when I run the query it asks me to enter parameter value
how can I get it to run without asking me anything?
when I run the query it asks me to enter parameter value
how can I get it to run without asking me anything?
ASKER
actualy I added the brackets and it stopped asking me for a parameter but did not return any records for this week unless I changed my system date to the 15 th
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dov_B,
upload a copy of the db
upload a copy of the db