var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: test datatype before converting
Can anyone tell me how to test a field in a sql statment before converting it?
I want to do something like convert a text field to an int if the text field has a number in it, otherwise I would like the result to be blank.
Right now, once it hits the record that contains text and therefore can't be converted, it gives the error: "Syntax error converting the nvarchar value 'mytext' to a column of data type int."
You could use the function ISNUMERIC with a CASE statement
SELECT CASE WHEN ISNUMERIC(myFld) THEN CAST(myFld AS int) ELSE '' END
Thank you very much! I'll give it a try.