Prev: Data Not Displayed in Query
Next: error
From: LisaK on 10 Mar 2010 16:05 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 10 Mar 2010 17:03 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 10 Mar 2010 17:11 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 |