That works fine on the initial insert. What about an update where a date existed before and now we want to delete the date? Only thing MSSQL will let you do is change to NULL. If you go into the Enterprise Manager, you can change the dates to NULL by doing a control 0. I am trying to write a statement that allows a NULL to be written as an update to the datetime field.
_____ From: Ted Wolfley [mailto:[email protected]] Sent: Monday, September 13, 2010 1:05 PM To: [email protected] Subject: RE: Witango-Talk: Updating or Inserting NULL into MSSQL datetime field If the date form field is blank don't include the date insert section as part of the insert statement. Best way is to use the Direct DBMS action. Ted From: WebDude [mailto:[email protected]] Sent: Monday, September 13, 2010 1:46 PM To: [email protected] Subject: Witango-Talk: Updating or Inserting NULL into MSSQL datetime field Hello, Can this be done? I have a table where they need to sort by date. The column is a datetime filed to sort dates correctly. we also need to be able to update the date, delete the date (make null) or keep the date null on an insert. Keeping the dat null on insert is fairly easy, but what if they want to sdelete the date? Adding blank form field defaults to 1/1/1900 in the db. Can an insert of NULL be written in SQL? I tried he obvious... <@IFEMPTY <@ARG date>>NULL<@ELSE><@ARG date>>/@IF>, <@IFEMPTY <@ARG date>>DbNull.value<@ELSE><@ARG date>>/@IF>, etc... Has anyone done this before? Thanks! _____ To unsubscribe from this list, please send an email to [email protected] with "unsubscribe witango-talk" in the body. _____ To unsubscribe from this list, please send an email to [email protected] with "unsubscribe witango-talk" in the body. ---------------------------------------- To unsubscribe from this list, please send an email to [email protected] with "unsubscribe witango-talk" in the body.
