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

Date passed to sub report

Status
Not open for further replies.
Mar 7, 2010
61
Hi

I have a date in my main report which is being passed by 3rd party software that interacts with crystal. This works fine.

I then need to pass that date period to my sub report, but not match it to the same field. It needs to match another date field in my sub report.

E.g. Main Report - has a GL Date period and Sub report has a production finish date that needs to be in the period of the GL Date.

I know how to link fields from main to sub report but I cant link the period and becuase they are different date fields I am not sure how to achieve this as easy as possible.

Can anyone help. I am using crystal 11.5.

Thanks
 
Create a formula which converts your datefield to the equivalnet Period and then link that formula to the period field in your subrerport.

If Period is straight month number

@Period
month(Datefield)

YOu can offset too, say priod 1 is June

@Period
month(Datefield)+5

If its dates that change year on year then its much more complex and will need formula extending into date ranges for future years.

Ian

 
How does the date period field display in the main report?

-LB
 
thanks both for response.

Ian - dont really understand this. I will have a play and see how I go.

LB - the date isnt actually displayed, its only used to determine what data is displayed on the report.

 
I am asking how it WOULD display if you placed it on the report--so I can tell how you would work with it as a linking field.

-LB
 
Sorry - based on the report currently it couldnt be displayed as the report is grouping by a higher level so showing the date wouldnt be possible. The format of the date direct from the db is date/time, however if was to display it I would just re format to dd/mm/yyyy. I am not sure if this answers your question?
 
So the field is a datetime datatype, not a string? How does the datetime define the period? Is it the beginning or end of the period? How do you determine the full range of the period?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top