Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One year ago today 1

Status
Not open for further replies.

vblack7770

Programmer
Apr 11, 2005
26
US
Crystal 8.5 with Oracle ODBC connection, XP.

I am trying to retrieve all records that meet the following criteria:

One year ago today
Example: 09/28/05 - I would like all records for 09/28/04.

(CurrentDate-365) doesn't seem to work.
 
Since currentdate-365 would be incorrect on leap years, try:

dateserial(year(currentdate)-1,month(currentdate),day(currentdate))

You can also use:

Dateadd("yyyy",-1,currentdate)


So in the Report->Edit Selection Formula-Record, use:

{table.date} = dateserial(year(currentdate)-1,month(currentdate),day(currentdate))

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top