Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock 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
Sep 26, 2005
4
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!!
 
Replies continue below

Recommended for you

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