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

How to convert date values to text and Concatenate in SQL Exp Builder

Status
Not open for further replies.

DyerQ

Technical User
Jun 19, 2003
7
0
0
US
I need to create a field to use as link to an outside database in the SQL expression Builder in Crystal Rep XI.

I am able to get Month()+ Year() from a date field but I need to

Convert Month() to string + Convert Year() to string + "String"

Then I would have something like 122009AB as my value to use for
my query connection to the outside table.

I don't see the functions to do this in the expression builder.
Can this be accomplished in the expression builder ?
Thanks in advance.
 
This really depends upon the functions available to your particular datasource, but you could try something like this:

{fn convert({fn month(`table`.`date`)},sql_varchar)}&
{fn convert({fn year(`table`.`date`)},sql_varchar)}&`table`.`string`

Or, if you are hardcoding the string: & 'AB'

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top