DMXzone Database Updater ASP Support Product Page

Under consideration

How to set date/time field to NULL

Shared 03 Jun 2016 15:02:07
1
likes this idea
03 Jun 2016 15:02:07 MX Addict posted:
When insert/update a empty textfield to datatype date/time in SQL server. I get the field filled with 1899-12-31T05:00:00Z. It is not possible with this extension to assign a NULL value.

The Dreamweaver insert/update behaviours did work with a function:

 <
%' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
  If condition = "" Then
    MM_IIf = ifFalse
  Else
    MM_IIf = ifTrue
  End If
End Function
%>


MM_IIF(Request.Form("date"), Request.Form("date"), null))


I need to insert/update a empty value in date/time

Replies

Replied 13 Jun 2016 07:47:09
13 Jun 2016 07:47:09 MX Addict replied:
Miroslav told during live support to write a topic about this question. But two weeks further still no response.
Replied 13 Jun 2016 08:49:39
13 Jun 2016 08:49:39 Teodor Kuduschiev replied:
Hello,
This is currently not possible. WE will discuss this idea with the team and will try to integrate this feature in the upcoming updates/releases.
Replied 13 Jun 2016 10:44:14
13 Jun 2016 10:44:14 MX Addict replied:
That will be nice. I need a date/time field that can be empty (Null)
Replied 24 Aug 2016 06:57:52
24 Aug 2016 06:57:52 MX Addict replied:
When will this be solved. I still need Null value for date/time

QuoteThis is currently not possible. WE will discuss this idea with the team and will try to integrate this feature in the upcoming updates/releases.

Replied 29 Nov 2016 09:34:51
29 Nov 2016 09:34:51 MX Addict replied:
Hi Teodor,

Still waiting to set Null value for date/time database field
Replied 30 Nov 2016 09:53:56
30 Nov 2016 09:53:56 Teodor Kuduschiev replied:
Hello,
You can try using:

.default(null)


in the value you insert to your db. Example - if you are inserting {{$_POST.date}} it should become {{$_POST.date.default(null)}}
Please let me know if this properly inserts a null value into the database field.
Replied 30 Nov 2016 10:39:09
30 Nov 2016 10:39:09 MX Addict replied:
Hi Teodor,

This doesn't work.

you can test the page with the link i send you yesterday

In my api file

"table": "tbl_test",
"column": "datum",
"value": "{{$_POST.hidden_datum.default(\"null\"}}",
"type": "datetime"

I use a hidden_datum field with Calendar 3. Has it to with this?
Replied 30 Nov 2016 10:44:42
30 Nov 2016 10:44:42 Teodor Kuduschiev replied:
Hidden field is not the issue. I will check this with our developers.

Reply to this topic