Solved

How to insert null in datetime field

Posted on 2012-03-21
4
363 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
  • 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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