473,796 Members | 2,455 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert >> null into Date/Time (Access2000)

I need to deposit and empty dummy value into a date/time field within Access
using INSERT. However, I pick up a data type error if I attempt to insert
a NULL value for this particular date time field....

What are my options here.....I need the date to come up empty.....what can I
do?

Many thanks
Jason
Jul 19 '05 #1
3 12048
> I need to deposit and empty dummy value into a date/time field within
Access
using INSERT. However, I pick up a data type error if I attempt to insert
a NULL value for this particular date time field....


Can you show the syntax and the actual error message? Narrative is very
difficult to debug.

Did you try

UPDATE table SET dateCOLUMN = NULL WHERE [...]

Notice that null is not in quotes or # delimiters, it's just a lone
keyword...
Jul 19 '05 #2
Sure. I am actually attempting an insert - not an update. I realise the use
of my delimiters is probably incorrect, however besides date time I usually
have no problem using these delimiters. My other update statements are
working fine but this particular insert is causing problems....my sql
statement falls apart if I remove the single delimiters (txt only)....

ActualClosingDa te=Request.Form .Item("ActualCl osingDate")

If len(trim(Actual ClosingDate)) > 0 then

ActualClosingDa te=ActualClosin gDate

Else

Response.Write "******"

ActualClosingDa te = Null

'ActualClosingD ate="00/00/00"

End If

SQL=SQL & "'" & ActualClosingDa te & "'," '#32 - date/time
SQL=SQL & "'" & SellingCommissi on & "'," '#33 - number
SQL=SQL & "'" & ListingCommissi on & "')" '#34 - number
Response.Write "<br>" & SQL & "<br>" & Active

'response.end

cnn.Execute(SQL )

"Aaron Bertrand - MVP" <aa***@TRASHasp faq.com> wrote in message
news:ey******** ******@TK2MSFTN GP10.phx.gbl...
I need to deposit and empty dummy value into a date/time field within

Access
using INSERT. However, I pick up a data type error if I attempt to insert a NULL value for this particular date time field....


Can you show the syntax and the actual error message? Narrative is very
difficult to debug.

Did you try

UPDATE table SET dateCOLUMN = NULL WHERE [...]

Notice that null is not in quotes or # delimiters, it's just a lone
keyword...

Jul 19 '05 #3
> ActualClosingDa te=Request.Form .Item("ActualCl osingDate")

If len(trim(Actual ClosingDate)) > 0 then

ActualClosingDa te=ActualClosin gDate
Try: ActualClosingDa te = "#" & ActualClosingDa te & "#"
Else

Response.Write "******"

ActualClosingDa te = Null
Try:
ActualClosingDa te = "NULL"
'ActualClosingD ate="00/00/00"
Please tell me you are not using mm/dd/yy or dd/mm/yy!!! There is no date
format more ambiguous and prone to errors and confusion! Try using
YYYY-MM-DD.

End If

SQL=SQL & "'" & ActualClosingDa te & "'," '#32 - date/time


Try:
SQL=SQL & ActualClosingDa te & ","
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3254
by: Keith | last post by:
I am Using Dreamweaver MX to create my site and have come accross a problem no one in the DW groups seems to be able to help with. When I submit an insert to my SQL database, any form value which is left blank is NOT inserted as a NULL value into the DB as I require but as blank data. How can I modify the DW-created statement below to insert a NULL if the field is empty?
2
23078
by: schumacker | last post by:
Hi everyone! I am working with Delphi v7 and MS SQLServer. I am trying to insert data in a table with a SQL sentence. Some of the fields of my table are type char or varchar, and they can have null values. ¿What do i have to write in the SQL sentence to insert a null value in those fields? I tried with '', an empty String, but it doesnt work, the tables stores an empty String (logical :-)). In the SQLServer GUI you have to press CTRL +...
10
52808
by: Python_it | last post by:
Python 2.4 MySQL-python.exe-1.2.0.win32-py2.4.zip How can I insert a NULL value in a table (MySQL-database). I can't set a var to NULL? Or is there a other possibility? My var must be variable string or NULL. Becaus i have a if statement: if .... cursor.execute(".................insert NULL ..............") if ....
6
16266
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 Field! (It is successful to pass the Null Value to other type of Field)
1
10404
by: SSG | last post by:
How to insert date to the sql server database. I am getting input from the HTML form and store it to database using ASP. how to store date field, what datatype needed and what conversion needed. Thanx & Regards, SSG
0
2297
by: hemant123 | last post by:
Hi I Am Trying To Insert Null Value In Oracle Date Column Using Visual Basic 6 Textbox. I Tried Various Options But Unable To Insert. Please Advise Me A Solution. Thanks In Advance Hemant
1
8537
by: hemant123 | last post by:
Hi I am trying to insert null value in date field using vbasic textbox.I tried various options but failed.Please tell me the solution. Thanks in advance. Hemant
0
1632
by: sourabhmca | last post by:
hi friend, I am want to insert date with time into sql server2000 using JSP.I hv 3 combo box for dd mm yyyy and 2 text box for hh and min ? and my table field type is smalldatetime.after that i want compare 2 date and want time in hh and min and display diff time and both date on sql server ? plz help soon?
1
2148
by: yzlin04 | last post by:
Does anyone know how to insert date into vb.net datagrid by using INSERT INTO command? From the code below, the error message is in cmd.ExecuteNonQuery() line. Here is the error message: An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll Dim today As Date today = Date.Today
1
3766
by: billa856 | last post by:
Hi, I am trying to insert Null value in column(ShipDate) in my table.That column(ShipDate)'s type id date/time and format is short date. I am using "" to insert Null in that column(ShipDate) but it shows warning that customer can't append all the records in the append query. Customer set 1 field(s) to Null due to a type conersion failure,and it didn't add 0 record(s) to the table due to key violation, 0 record(s) due to lock...
0
9680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10228
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10006
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.