?
Solved

How to insert null in datetime field

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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

741 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