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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show data from date range that is -1 year from query

Status
Not open for further replies.

spinbad

Technical User
Feb 1, 2006
3
US
Greetings,

using crystal reports 8.5 getting data from a progress database. I was wondering if there is a way to select data from -1 year from the user entered parameter query in a formula?

So if the user enters 1-1-05 - 1-1-06, the formula will select data from 1-1-04 - 1-1-05

 
Sure, go to Report->Edit Selection Formula->Record and use something like:

(
{table.date} >= dateserial(year(minimum{{?MyDateRange})-1),month(minimum{{?MyDateRange})),day(minimum{{?MyDateRange})))
and
{table.date} <= dateserial(year(maximum{{?MyDateRange})-1),month(maximum{{?MyDateRange})),day(maximum{{?MyDateRange})))

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top