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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Here's a challenge for you. 1

Status
Not open for further replies.

Bullsandbears123

Technical User
Feb 12, 2003
291
US
The challenge is this.

You have data in a table with two fields "appdate" and "text"

[appdate] [text]
1/1/2004 DTD
1/1/2004 MTD
1/30/2004 DTD
1/30/2004 MTD
1/31/2004 DTD
1/31/2004 MTD
2/5/2004 DTD
2/5/2004 MTD
2/29/2004 DTD
2/29/2004 MTD


The goal is to display all the records that have DTD, but only the MTD records that have date on the last day of any given month.

SO the Query should give you this....

[appdate] [text]
1/1/2004 DTD
1/30/2004 DTD
1/31/2004 DTD
1/31/2004 MTD
2/5/2004 DTD
2/29/2004 DTD
2/29/2004 MTD

Any ideas? I'm stumped.
 
Hi,

[tt]
...
Where ([text]='DTD') OR ([text]='MTD'
AND Month([appdate])<>Month([appdate]+1)))
[/tt]
:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
THANK YOU, SO MUCH, YOUR A GENIUS!!!!

I thought it was going to be really complicated, but no, you made it so easy, I never thought of using month() function.

AGAIN THANK YOU!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top