From: LisaK on
Hello,

I am using the date serial function in a query to pull data that is reported
2 months after the fact. I can get the start date to work
DateSerial(Year(Date()),Month(Date())-2,1). But I cannot get the end date to
come up correctly. Can someone please help me on this one.

Thanks much.
From: John W. Vinson on
On Wed, 10 Mar 2010 13:05:01 -0800, LisaK <LisaK(a)discussions.microsoft.com>
wrote:

>Hello,
>
>I am using the date serial function in a query to pull data that is reported
>2 months after the fact. I can get the start date to work
>DateSerial(Year(Date()),Month(Date())-2,1). But I cannot get the end date to
>come up correctly. Can someone please help me on this one.
>
>Thanks much.

Not without knowing what you consider the end date. You didn't say!

GUESSING that you want all the records from January 2010 if you run the query
today, try

>= DateSerial(Year(Date()), Month(Date()) - 2, 1) AND < DateSerial(Year(Date()), Month(Date()) - 1, 1)

--

John W. Vinson [MVP]
From: KARL DEWEY on
Try this --
DateSerial(Year(Date()),Month(Date())-1,0)

--
Build a little, test a little.


"LisaK" wrote:

> Hello,
>
> I am using the date serial function in a query to pull data that is reported
> 2 months after the fact. I can get the start date to work
> DateSerial(Year(Date()),Month(Date())-2,1). But I cannot get the end date to
> come up correctly. Can someone please help me on this one.
>
> Thanks much.
 | 
Pages: 1
Prev: Data Not Displayed in Query
Next: error