473,395 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

insert null into datetime field

219 100+
I have this query that I'm using in coldfusion:

Insert into ps_manager_employee_ids (manager_emplid,emp_id,last_name,first_name,hire_d t,rehire_dt,emp_status,union_status)
values ('#manageremplid#','#emplid#','#last_name#','#firs t_name#','#hire_dt#','#rehire_dt#','#emp_status#', '#union_status#')

I'm trying to insert some date values, but they are entering as 1/1/1900 instead of NULL. How can I insert them as null instead?
Oct 31 '08 #1
2 10581
code green
1,726 Expert 1GB
Insert an empty value
Expand|Select|Wrap|Line Numbers
  1. field = ''
Oct 31 '08 #2
ck9663
2,878 Expert 2GB
try this:


Expand|Select|Wrap|Line Numbers
  1. Insert into ps_manager_employee_ids (manager_emplid,emp_id,last_name,first_name,hire_d t,rehire_dt,emp_status,union_status)
  2. values ('#manageremplid#','#emplid#','#last_name#','#firs t_name#',NULL,NULL,'#emp_status#', '#union_status#')
Happy Coding!

-- CK
Oct 31 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Phil Powell | last post by:
I have a mySQL database table with a column field datatype of datetime that I set up in the original create table statement like this: create table nnet_usermetadata ( .... nnet_record_entered...
0
by: M. Bader | last post by:
Hi, i'm struggling with updating session expire times in my login table. Can you tell me, how to correctly add an amount of seconds (after that the session expires) to a datetime field? ...
3
by: heroe | last post by:
Hello *, i write you with an urgent problem. I would like to create forign keys to datetime field, but it doesn't seem to work. I get Can't create table '.\sampleDB\student_module.frm' (errno:...
8
by: Manish Jain | last post by:
Platform : ASP.Net/C# void SomeFunction(DateTime date) { string text = date.ToString(); //This crashes if date is null } I am using a construct similar to above. I want to check if the date...
6
by: FatboyCanteen | last post by:
When I using dataset to append a null value to the datetime field. It throw a error -> can not convert db.null to system.date Can there is any standard to pass a Null value to the DateTime...
4
by: kd | last post by:
Hi All, I have a datetime column in a table on the SQL database. I need to insert values into the datetime column from vb.net code. Here is my code: dim nameval, str, qry as string nameval =...
1
by: Mike the Canadian | last post by:
Suppose I have a MySQL 5 table with a DateTime field in it. The table has two records where the time is blank. Running: SELECT CAST(DateTimeField AS TIME) FROM MyTable shows two records with...
2
by: gradeA | last post by:
Hi, I am having trouble inserting data into a datetime field in MSSQL. Here is the script I am trying to execute: $now = date('d/m/Y g:i:s A'); mssql_query("INSERT INTO clients...
1
by: Brad Pears | last post by:
I am using vb.net 2005 and SQL server 2000. In my table I have a date field of type "smalldatetime". In my vb application, the user may or may not enter a date value into the appropriate text box....
2
by: mzmishra | last post by:
Hi, How can I insert Null value to a DateTime field. Is there soem thing like DateTime dt=......something
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.