Previous Year Query (1 Viewer)

TVReplay99

Registered User.
Local time
Today, 19:43
Joined
Jan 2, 2002
Messages
29
I feel really stupid asking this and I sure it is just a mental block but, I nees to yun a summary of last years sales from the [Sales] table with date from several years. I cant think of how to run a query that selects all sales from the previous year. The [Sales].[Date] field is formated mm/dd/yyy. Please helpmy get past this mental road block.

Brian
 

Alexandre

Registered User.
Local time
Tomorrow, 01:43
Joined
Feb 22, 2001
Messages
794
By previous year, do you mean last year ?

SELECT Sales.*
FROM Sales
WHERE (((Year([DateField]))=Year(Date())-1));

Note that you should not use reserved names like Date for you DB objects (hence my: DateField)

Alex

[This message has been edited by Alexandre (edited 02-25-2002).]
 

TVReplay99

Registered User.
Local time
Today, 19:43
Joined
Jan 2, 2002
Messages
29
Thank you, thank you, thank you. Just having one of those days.
 

Users who are viewing this thread

Top Bottom