Solved

How to insert null in datetime field

Posted on 2012-03-21
4
353 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
Comment Utility
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
Comment Utility
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
Comment Utility
try this

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

Author Closing Comment

by:searchsanjaysharma
Comment Utility
ok
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In this article I will describe the Backup & Restore 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 is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now