CAST (expression AS data-type)... Need an alternative function for the same in MS-SQL Server.

Returns the value of expression, converted to the supplied data-type.
Cast function supports the conversion to User Defined Data Type (UDT).
UDT - C_Date (Base data type - Char(12))

Cast (GetDate() as C_Date) : This will convert the current date in char(12) format.

MS-SQL Server 6.5
Convert function can not be used.
As User Defined data type cannot be used.
Gives the error - '<> is not a defined system type.'
Need an alternative function for the same in MS-SQL Server.
Who is Participating?
simonsabinConnect With a Mentor Commented:
This not possible in SQl server. I know it is not the answer you want but unfortunately that is the answer
Gustavo Perez BuenrostroCommented:
CONVERT and CAST functions only work using SQL Server-supplied data types (User-defined data types cannot be used)
However, you can do something special to resolve your problem.
Let me know if you are interested in.


This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.
Thank you,
Moderator @ Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.