Hi all
Trying to create a parameter based on Today's Date, so the query looks at Dates in the table from: The start of the month a year ago, to the end of last month. i.e. Today's date happens to be 21st Sept 04, so I want to return From:1st Sept 03, To:31st Aug 04. I've been playing with DateSerial, but getting unexpected results. Here are the expressions I'm using:
From: DateSerial(Year(Date())-1,Month(Date()),Day(1))
To: DateSerial(Year(Date()),Month(Date())-1,Day(Date()-(Day(Date()+1))))
But instead of getting 1/9/03 and 31/8/04 I'm getting 1/10/03 and 30/8/04
Any ideas?
With thanks
Laters, Z
"42??? We're going to get lynched!
Trying to create a parameter based on Today's Date, so the query looks at Dates in the table from: The start of the month a year ago, to the end of last month. i.e. Today's date happens to be 21st Sept 04, so I want to return From:1st Sept 03, To:31st Aug 04. I've been playing with DateSerial, but getting unexpected results. Here are the expressions I'm using:
From: DateSerial(Year(Date())-1,Month(Date()),Day(1))
To: DateSerial(Year(Date()),Month(Date())-1,Day(Date()-(Day(Date()+1))))
But instead of getting 1/9/03 and 31/8/04 I'm getting 1/10/03 and 30/8/04
Any ideas?
With thanks
Laters, Z
"42??? We're going to get lynched!