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

Dates 2

Status
Not open for further replies.

ganjass

Technical User
Dec 30, 2003
154
GB
CR10

Hi,

i want to bring back all records for the month that is the maximum in the date range that i'm passing as a paramater. But i cant seem to get it to work, any ideas,

Thanks in advance
 
For your record select, use:

{table.date} = maximum({?date})

-LB
 
will that bring back all the records for the last month?
 
Try

DatePart ("m",{Table.Date} ) = DatePart("m",Maximum({?Date}))

This will be evaluated by crystal so could hace an impact on performance

HTH

Gary Parker
Systems Support Analyst
Manchester, England
 
You will probably want to expand Gary's a little, so that you get the correct year as well:

DatePart ("m",{Table.Date} ) = DatePart("m",Maximum({?Date}))
and
DatePart ("yyyy",{Table.Date} ) = DatePart("yyyy",Maximum({?Date}))

~Brian
 
Sorry, I misread your post. The other solutions posted should work, and if you have multi-year data, you would want to use Brian's.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top