
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Concat date field into string
Hi experts,
I have a date field, I want to concat the dates into a string, each date should be in a pair of single quote.
For example, I have data like below,
data:
LOAD * Inline
[
cob_date
'12/1/2018'
'12/2/2018'
'12/3/2018'
'12/4/2018'
]
the string I want is
'12/1/2018','12/2/2018','12/3/2018','12/4/2018'
I defined a variable like this:
vCon_date : =Concat(chr(39) & cob_date & chr(39), ',', cob_date)
but when I put the $(vCon_date) into a text box, I got "Error: Garbage after expression: "," "
Where am I wrong?
the qvw file is attached..
Thanks,
Michael
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Have you tried below script to concat the values?
ZZ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@msmichael wrote:
vCon_date : =Concat(chr(39) & cob_date & chr(39), ',', cob_date)
Just remove the Red color text


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
Use
vCon_date directly instead
$(vCon_date)
Best Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
vCon_date = Concat(chr(39)&cob_date&chr(39),',')
now check in textbox =vCon_date
result : '12/1/2018','12/2/2018','12/3/2018','12/4/2018'
if you given variable calculation without equal sign (=) use $(vCon_date )
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for your reply. I have to do it in an expression, so can't do it this way..
Michael

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for your reply, but I need the dates to be sorted, so can't remove the red color text..
Michael
