How could this query be coded?
i'm racking brain trying figure 1 out...this old query of mine being retooled...
db has field month , field year...as hours each record.
this query pulling sum of hours date range, year oct sep.
so want query says:
select * october december of last year, , months january of current year "selected" month.
i have setup current year, prior year, , selected month (from dropdown list).
i've tried like:
select sum(hours) total tablename
where service_year = #session.prior_year# , service_month >= 10 , service_month <=12 , service_year = #session.selected_year# , service_month >= 1 , service_month <= #session.selected_month#
no dice of course, logically doesn't work anyway after looking @ it.
any ideas? i've tried various forms of evaluation levels of operators, no dice.
thanks in advance!
maybe:
where
(service_year = #session.prior_year# , service_month >= 10)
or (service_year = #session.selected_year# , service_month <= #session.selected_month#)
More discussions in Database Access
adobe
Comments
Post a Comment