Link to home
Start Free TrialLog in
Avatar of redgreenred
redgreenred

asked on

convert date to text

I am trying to concatenate 2 attributes of different data types...

One is date (TRANS_DT), and another one is text (Customer_Name)

I am usign the following query

select
(TRANS_DT+Customer_Name) as key_combo
from
table_A

getting an error message
"Syntax error converting datetime from character string."

Please advice...
Avatar of chapmandew
chapmandew
Flag of United States of America image


select
(cast(TRANS_DT as varchar(30)) +Customer_Name) as key_combo
from
table_A
Avatar of redgreenred
redgreenred

ASKER

getting the same error message

"Syntax error converting datetime from character string"
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial