Click here to Skip to main content
15,663,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How do I Replace NULL value for the datetime with blank space instead of default value of datetime
OriginalGriff 28-Apr-14 4:34am    
Depends to a large extent what exactly you are doing to retrieve the data.
Show us the code fragment that you are using.
Ni!E$H_WAGH 28-Apr-14 4:40am    
I want Update column with NULL value by blank space .
phil.o 28-Apr-14 4:43am    
Are you trying to store a datetime value into a varchar column?
Ni!E$H_WAGH 28-Apr-14 4:52am    
No am using datetime as datatype for specified column
phil.o 28-Apr-14 5:23am    
So, this is not possible to store a blank space in a DateTime column.
At that time, what is stored in this column? A null value, or the default value for Datetime?

1 solution


I think you can solve this problem with ISNULL. Implement it according to your requirement.

SELECT ISNULL(ColName, '') AS ColName FROM TableName

also check[^]

Good Luck
Share this answer
Ni!E$H_WAGH 28-Apr-14 5:13am    
No it gives output 1900-01-01 00:00:00.000 and I require ' '

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900