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

Rearrange Date Field w/ Parameter Formula

Status
Not open for further replies.

IronRocket

Technical User
Dec 28, 2005
74
US
I’ve just created a report that has a parameter asking the user for a date range. The date field is formatted yyyy-mm-dd. The range of date that they choose I put in the page header section “IRs between yyyy-mm-dd and yyyy-mm-dd” that is a formula: "IRs between " & Minimum({?Date}) & " and " & Maximum({?Date});…So far so good. Only problem is that now I have to switch the format to mm/dd/yyyy…so I created a formula for this to rearrage the format: {CallLog.RecvdDate} [6 to 7] & "/" & {CallLog.RecvdDate} [9 to 10] & "/" & {CallLog.RecvdDate} [1 to 4]…I put this in a group header and it picks out the characters just fine and puts it how I want it (mm/dd/yyyy).

The only problem is that I want to put this in the page header where I already have the formula taking the user’s input from the parameter’s formula showing the date range. I don’t know how in the world I can put the two above formulas together to have the title in the page header say (with the new date format): “IRs from mm/dd/yyyy To mm/dd/yyyy.” Anyone have any suggestions?
 
Use:

"IRs between " +totext(Minimum({?Date}),"MM/dd/yyyy") + " and " + totext(Maximum({?Date}),"MM/dd/yyyy")

PS. The "MM"s need to be caps to distinguish months from minutes.

-LB
 
lbass:

Thanks for your help again...but unfortunately, it's giving me an error message:

"Too many arguments have been given to this function"

So it looks like the toText function doesn't like the Minimum and Maximum function being in there?
 
One more thing:

For the heck of it, I put in the following formula:

"IRs between " + Minimum({?Date},"MM/dd/yyyy") + " and " + Maximum({?Date},"MM/dd/yyyy")

It gave me the same error. It looks like the Minimum & Maximum functions doesn't like more than one argument... but I know that can't be true.
 
What is the datatype of your date parameter?

-LB
 
I put the datatype of my date parameter as a string because in the database, it is classified as a string as well.
 
IRs between "+mid(minimum({?Date}),6,2)+
"/"+mid(minimum({?Date}),9,2)+
"/"+left(minimum({?Date}),4)+ " and " +
mid(maximum({?Date}),6,2)+
"/"+mid(maximum({?Date}),9,2)+
"/"+left(maximum({?Date}),4)

-LB
 
Thanks again LBass! It worked for me. The date format is showing up like I need it to show.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top