Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start Date to End Date Overlap Last Month 1

Status
Not open for further replies.

mychal

Programmer
Feb 13, 2002
41
0
0
US
I have a table with a Start Date field and an End Date field. I want to see all records in that table where the range between the Start Date and End Date hit some or all of last month.

For example, if this is my data:

Record # Start Date End Date
1 10/3/2004 10/15/2004
2 10/8/2004 11/13/2004
3 9/2/2004 12/3/2004
4 11/5/2004 11/20/2004
5 11/7/2004 12/4/2004
6 12/2/2004 12/5/2004

I would want to return 2, 3, 4, and 5.

How could I do this?

Thanks.
 
I think this'll do it:

(Minimum(LastFullMonth) in {Table.StartDate} to {Table.EndDate}
Or
Maximum(LastFullMonth) in {Table.StartDate} to {Table.EndDate}
Or
({Table.StartDate} in LastFullMonth And {Table.EndDate} in LastFullMonth))

-dave
 
Excellent. Much more concise than my method.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top