Querying records prior to a certain period

D

Denyse

I'm working with a period-based accounting system. I've
created a form that prompts for a Beginning Period,
Ending Period and Year for purposes of querying data for
a report. It's not common for the report to be run
across years - i.e., the reports wouldn't normally be run
from Nov. 2002 to Feb. 2003. So I'm only working with
form criteria for the report that reflects a single year.
I'm now trying to obtain a certain set of data but I'm
having difficulty figuring out how to do it. I can
easily ask for what payments have been received between
Feb. and April 2003. What I'm trying to figure out is
how I can indicate that I want to obtain data for
anything prior to Feb. 2003. The resulting data must
include anything received in any period prior to Feb.
2003 - inclusive of Jan. 2003, Dec. 2002, Nov. 2002, etc.
This is in regards to calculating all Accounts Receivable
payments received prior to the Beginning Period indicated
on the form. Any help would be appreciated.
 
M

[MVP] S. Clark

You didn't really specify how your application executes, especially how your
query is running, or what the SQL Code is, etc.

Typically, with a form for criteria specification, you would use VBA code to
create a SQL statement to execute with the specified

i.e. strSQL = "Select * from tablename WHERE thisdate Between #" &
txtStartDate & "# AND #" & txtEndDate & "#"

Or if calling a report

strWhere = "thisdate Between #" & txtStartDate & "# AND #" & txtEndDate &
"#"
Docmd.Openreport "reportname", WHERE := strWhere

--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top