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

comparing dates

Status
Not open for further replies.

flamenco

Computer
Joined
Sep 26, 2005
Messages
4
Location
MX
Hi:

I'm using access and I have the "Invoices" table

Invoices
----------------------------------------
Folio RegisterDate CancelDate
----------------------------------------
1 15/01/2004 20/01/2004
2 20/02/2004 13/03/2004
3 30/03/2004 15/05/2004
4 01/05/2004 15/05/2005
5 10/06/2005 25/06/2005

I want to make a query that returns "Folio" where "RegisterDate" and "CancelDate" are in diferent month or year like this

Query
--------
Folio
--------
2
3
4

How can I make this query?

Thanks!!
 
Pretty simple:

select folio from invoices where
(month(registerdate)<>month(canceldate)) or
(year(registerdate)<>year(canceldate))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top