This content has been marked as final. Show 5 replies
I guess you are referring to CONVERT 08/01/2011 to 20110801, right
The best approach will always be to perform all data transformations in the database.
In your case it depends if 08/01/2011 is in date format : YYYY-MM-DDThh:mm:ss+HH:MM
If it is in date format then it is easy to convert it to the format you wanted as follows:
To convert to number you would do: <?xdofx:to_number('12345')?>
But on a second thought what is it the ultimate goal of converting it to number???
you can use substring function to do that in template
do use in combination to get what you wanted.
<?substring(DATE_FIELD,7,4)?> -- will get 2011 <?concat ('a','a','a')?> will get aaa
get this done in DB . but if its a small report, doing it template is what most prefer.
Thanks for the info :)
One more thing, do the concatenated values will be treat as a string even if the concatenated values are numbers?
08/01/2011 will become 20110801
Yes, its a string.
But if you want to compare as numbers you can do so, given both sides of comparison are numbers.
thanks a lot! :)