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

Using JOIN function to display discrete date values from a parameter

Status
Not open for further replies.
Jan 8, 2002
12
US
How do I display discrete date values selected from a date parameter? I can easily display the first (minimum) and last (maximum) dates in a range, but what if I want only certain discrete dates that a user has selected, such as 8/14/03, 8/19/03, 8/27/03, etc.?
 
There is a formula on the FORMULAS page of my web site that shows how to do this. JOIN only works with strings.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- tek@kenhamady.com
 
Sorry, I should have pointed out that you use a formula similar to the one for multiple numeric parameters. I dont' have a specific example of dates - but it is essentially the same.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- tek@kenhamady.com
 
I'd create a string array variable and loop through the dates and populate the string array, then use the Join function.

If you need an example I'll work one up.

-k

 
Hey Mike--

You've probably already got this from the above, but just in case:

whileprintingrecords;
stringvar dates;
numbervar counter;
numbervar i := count({?date});

for counter := 1 to i do(
dates := dates & totext({?date}[counter],"MM/dd/yyyy") & ", ");
left(dates, len(dates)-2);

-LB

P.S. Yay, Crugsters!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top