in Education by
I have a table which contains 'NULL' values which are of type 'Datetime'. Now i have to convert those into empty string but when when i use convert function ISNULL( [Accrued Out of Default] ,'' ) here accrued into default is of datetime type, what it does it changes null to '1900-01-01 00:00:00.000' instead of empty Then i try to convert them into varchar and apply same ISNULL(CONVERT(varchar(50), [Amort Into Default] ),'') Now I am able to convert into empty string but now those datetime are converted to string which I needed in datetime So I try to CAST, CONVERT but non of them works. CONVERT(Datetime,'ISNULL(CONVERT(varchar(50), [Amort Into Default] ),'')',120) This gives error. Is there any possible solution to this. > **Solution Hi someone answered this to do as. > ISNULL(CONVERT(varchar(50), [Amort Into Default] ,120),'') and it works I dont know why . ** JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
CASE and CAST should work: CASE WHEN mycol IS NULL THEN '' ELSE CONVERT(varchar(50), mycol, 121) END

Related questions

0 votes
    How to get time in hours and the hour difference between login and logout times? I used the below ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 12, 2022 in Education by JackTerrance
0 votes
    How to get time in hours and the hour difference between login and logout times? I used the below ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 6, 2022 in Education by JackTerrance
0 votes
    How to get time in hours and the hour difference between login and logout times? I used the below ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    For some reason, when I try to install SQL Server 2008 Express, I get an error saying that I need ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    For some reason, when I try to install SQL Server 2008 Express, I get an error saying that I need ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    I am a newbie to Scala and I want to learn how can I add null and empty check on an optional ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 6, 2022 in Education by JackTerrance
0 votes
    I am a newbie to Scala and I want to learn how can I add null and empty check on an optional ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 26, 2022 in Education by JackTerrance
0 votes
    I am a newbie to Scala and I want to learn how can I add null and empty check on an optional ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 12, 2022 in Education by JackTerrance
0 votes
    I want to covert a large complex date-time string into proper datetime fields in a database, Can someone tell me a ... can't use SQL. Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    In the code below, in "parse" function I am trying to get substring from the string "line". I am ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 16, 2022 in Education by JackTerrance
0 votes
    In the code below, in "parse" function I am trying to get substring from the string "line". I am ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 5, 2022 in Education by JackTerrance
0 votes
    PHP's explode function returns an array of strings split on some provided substring. It will return empty ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    PHP's explode function returns an array of strings split on some provided substring. It will return empty ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    PHP's explode function returns an array of strings split on some provided substring. It will return empty ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    Does Python have something like an empty string variable where you can do: if myString == string.empty: Regardless, ... not as good. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
...