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!

Subreport - LINK MMYY to MMDDYY

Status
Not open for further replies.

plextor

IS-IT--Management
Jan 7, 2003
34
US
CR10

I'm attempting to use a subreport and link the date fields. The main report has a date field of MMYY, the subreport has MMDDYY, I created a group in the sub report that summarizes the MMDDYY to MMYY, however I can't figure out a way to link one another.

Thanks,
Brian
 
I guess that this "I created a group in the sub report that summarizes the MMDDYY to MMYY" means that you created a formula which converts the date to a MMYY only field and it is used as a group.

If so, then you should be able to link the MMYY field in the main report to the MMYY formula in the subreport, providing they're of the same data type.

When discussing how a formula might be used, you should be posting what's in the formula.

-k
 
What is the datatype of your date field in each report? If it is a string in both, then in the subreport, you would need to write a formula:

left({table.stringdate},2)+right({table.stringdate},2)

Then link the date field from the main report to this formula in the subreport.

-LB
 
Sorry for the lack of information.

Both field types are "Date". It looks like i need to create a formula converting the Date field from MM/DD/YY to MMYY. If so, how?

Thanks again for all the help.....
 
A date field cannot be MMYY, so you still have something amiss. Date fields are as they sound, for dates, not months.

Right click the field and select Browse Data, it will tell you it's data type and example data.

The data types have to be the same.

If you're using a MMYY, thn it's probably a zero padded string, to create the same thing use:

stringvar MyMonthYear;
if len(totext(month(currentdate),0,"")) = 1 then
MyMonthYear:="0"&totext(month(currentdate),0,"")
else
MyMonthYear:=totext(month(currentdate),0,"");
MyMonthYear:=MyMonthYear&totext(year(currentdate),0,"")

Replace currentdate with your date field.

-k

 
That did the trick....... Thank you very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top