Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to insert null in datetime field

Posted on 2012-03-21
4
Medium Priority
?
369 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

604 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