Either create a new column in your query that uses Year([DateIn]), and put
use Year(Date()) - 5 as the criteria for it (so that you'll have WHERE
Year([DateIn]) = Year(Date()) - 5), or try
BETWEEN DateSerial(Year(Date())-5,1,1) AND DateSerial(Year(Date())-5,12,31)
(If DateIn contains time as well as date, you'll need to use
DateSerial(Year(Date())-4,1,1) to ensure that you get everything from Dec
31st)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)
"PMBragg" <pmbragg@megavision.com> wrote in message
news:VGUNb.471$9a.11817@news.uswest.net...[color=blue]
> This works great, but I don't want to have to remember each year to do[/color]
this.[color=blue]
> Is there a way to do this programmatically in a Query?
>
> Such as DateSerial uses negative or positive numbers to pull certain data?
>
> <=DateSerial(Year(Date())-5,1,1) And <DateSerial(Year(Date()),1,1)
>
> Pulls all records 5 or more years old. What if I just want the 5th YEAR
> ONLY?
>
> Michael
> "Peter Doering" <nospam@doering.org> wrote in message
> news:bu8ot2$et99i$1@ID-204768.news.uni-berlin.de...[color=green]
> > On Fri, 16 Jan 2004 04:10:12 -0600, PMBragg wrote:
> >[color=darkred]
> > > Thank you everyone that helped me with my DateSerial question. I[/color][/color][/color]
really[color=blue]
> do[color=green][color=darkred]
> > > appreciate it. Now my accountant has told I need to pull the inventory[/color][/color]
> for[color=green][color=darkred]
> > > just the year I'm depreciating. Is there a way to isolate by my[/color][/color][/color]
[DateIn][color=blue][color=green][color=darkred]
> > > field, to get the Year I need?[/color]
> >
> > Year([DateIn])
> >
> > HTH - Peter
> >
> > --
> > No mails please.[/color]
>
>[/color]