dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: insert a null value to a date field

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    insert a null value to a date field

    [Originally posted by Ganesh]

    Hi friends,
    In my project i have to insert a null value in to my database table. can it be possible. sometimes i'll insert the correct date based on requirement.
    i'm not getting solution for this. please help me in finding this
    mail me if u got the solution
    thanx
    Ganesh

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:insert a null value to a date field

    [Originally posted by Marcel Slooff]

    When you are using SQL statements to insert and update records its quite easy you just use the NULL key word in your SQL statement for the field you want to contain NULL. Also when your inserting a new record into the database your not required to provide a value at all and by default NULL is 'inserted'. So when you insert a new record just omit assigning a value to the field you would like to contain NULL and than it will contain NULL. Offcourse the field properties in the database must be set so that the field actually allows NULL values.

    Greetz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center