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!

Selection date troubles

Status
Not open for further replies.

Horns

Technical User
Nov 8, 2002
12
GB
I need a report to give me all the info where the record date is within 6 months. I have a Start Date parameter field where the user will enter the start date i.e 01/04/03 I now need crystal to subtract 6 months from that. so Effectivly the only data CR extracts is betwwen 01/04/03 and 01/10/02. Thanks
 
Thanks for that, although I'm, getting some strange results. Which would suggest I’m using it wrong.
For the sake of getting manageable data I want to display the month I choose in my parameter field and the previous month. The following is my selection expert (My start date is 01/05/2002): -
{recdate} >= {?Start Date} and
{recdate} >= DateAdd('M',-1,{?Start Date})

This is returning 3 months worth?? but even stranger 2 months into the future i.e. all of Mays data, all of Junes data and all of Julys??
A bit of guidance of where to use this would be much appreciated.



 
Your criteria has changed from the original post.

{recdate} >= cdate(year(DateAdd('M',-1,{?Start Date})),month(DateAdd('M',-1,{?Start Date})),1)
and
{recdate} <= cdate(year(DateAdd('M',1,{?Start Date})),month(DateAdd('M',1,{?Start Date})),1)-1

(might be a minor syntax error as I didn't test).

This would return 2 months worth of data, the month selected and the previous month.

-k
 
Thanks for both the responses. I didn't phrase my first post properly, but still got another function I can have a play with.
 
Your original attempt may have worked if you hadn't specified >= twice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top