The sql functions CAST CONVERT not working in AA360 Database: Export to Data Table.
Page 1 / 1
Hi
Here are a few steps you can try:
-
Check Syntax and Data Types:
- Ensure that the syntax of your SQL query is correct. Double-check the usage of
CAST
andCONVERT
. - Verify that the data types you’re converting between are compatible. For example, if you’re converting an integer to a string, use
CAST(id AS varchar(200))
.
- Ensure that the syntax of your SQL query is correct. Double-check the usage of
-
String Truncation:
- If you’re using
CAST
to truncate strings, make sure that thestring_rtruncation
database option is set to OFF. Otherwise, you might encounter errors. - Alternatively, consider using the
LEFT
function to truncate strings1.
- If you’re using
-
Sample Query:
- To force integer format, try the following query:
SELECT CAST(CAST(id AS BIGINT) AS varchar(200)) FROM Programmer].mdbo].[Diabetic Patient 12 years ove$]
- To force integer format, try the following query:
Remember to adapt these suggestions to your specific use case. If you encounter any further issues, feel free to ask for more assistance!
Here is the answer goodgist generated for you. Find it helpful ?
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.