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!

How to Concatenate Dates - Need help Please

Status
Not open for further replies.

tlbrown88

Technical User
Jun 28, 2010
20
US
Hello all - I am a bit stumped. I am trying to concatenate a series of dates that are already in the 05/23/18 format.

For example, I have the following:

Order # RDD
20012512 05/23/18
20012512 06/01/18
20012512 07/03/19

At the GF I'd like to see:
20012512 05/23/18; 06/01/18; 07/03/19

I need this to reset after each Order # so I do know I need formulas in the GH, Details and GF..... I just keep getting the following error {ZCUSTORD.PROM_DATE} "A string is required here".
I tried using the "dateVar := ;" operator but I can't seem to get it to work.

Any ideas as to where I am messing up??
 
Whileprintingrecords;
Stringvar dt := dt + totext(yourdatefield,”MM/dd/yy”)+
(
If onlastrecord or
{table.order#}<>next({table.order#}) then
“” else
“; ”
);

(Replace the quotes if you copy this, when you change to the actual field names, since CR won’t read my iPad quotes correctly.)

In the group header, add a reset formula:

Whileprintingrecords;
Stringvar dt := “”;

In the group footer, add the display formula:

Whileprintingrecords;
Stringvar dt;
{table.order#}&dt

The ampersand will allow you to concatenation fields of different data types, but because you wanted to accumulate dates along with another string “;”, it makes sense to use a string variable for that purpose.

-LB
 
Great! I will try this! I did find a work around by converting the date to a string but it is clunky.
I will give your example a try in the morning as I'm off to a baseball game now.
Thanks much LB, I will report back!! *Ü*
 
Just wanted to pass a note that your input worked perfectly LB, I appreciate the help! [bigsmile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top