Solved

How to insert null in datetime field

Posted on 2012-03-21
4
366 Views
Last Modified: 2012-03-21
How to insert null in datetime field, I want to pass it as a parameter from front end.
and then how to read null date value from table.
0
Comment
Question by:searchsanjaysharma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 39

Expert Comment

by:appari
ID: 37750760
from front end to pass null value to db assign dbnull.value to the parameter value.
for more help can you post existing code?
0
 

Author Comment

by:searchsanjaysharma
ID: 37750931
It worked, Now how to retrieve it.
Covertaken and coverdate are two fields.

select Covertaken+'-'+convert(varchar,coverdate,106) from emp
not works if coverdate is null
0
 
LVL 39

Accepted Solution

by:
appari earned 500 total points
ID: 37750984
try this

select Covertaken+isnull('-'+convert(varchar,coverdate,106),'') from emp
0
 

Author Closing Comment

by:searchsanjaysharma
ID: 37751042
ok
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question