{"id":13,"date":"2007-12-06T11:20:00","date_gmt":"2007-12-06T11:20:00","guid":{"rendered":"http:\/\/supportingelement.wordpress.com\/2007\/12\/06\/how-to-check-if-a-date-element-is-null\/"},"modified":"2007-12-06T11:20:00","modified_gmt":"2007-12-06T11:20:00","slug":"how-to-check-if-a-date-element-is-null","status":"publish","type":"post","link":"https:\/\/supportingelement.com\/index.php\/2007\/12\/06\/how-to-check-if-a-date-element-is-null\/","title":{"rendered":"How to check if a Date Element is Null"},"content":{"rendered":"<p>\nTesting if a Date Element is null within a Formula Element is simple, right?  It is not as obvious as you may think.\n<\/p>\n<p>\nIf you attempt to do this by comparing the date to a numeric value of zero you receive the following error when validating the formula \u201cMixed datatypes used as operands. (17000,1768)  The operand(s) on either side of an operator must be of the same datatype.\u201d.\n<\/p>\n<p>\n<a href=\"http:\/\/bp0.blogger.com\/_jye0NzelumM\/R1fcRyLElFI\/AAAAAAAAAEU\/7rUgvOUIzLI\/s1600-h\/NullDate1.GIF\"><img decoding=\"async\" style=\"display:block;text-align:center;cursor:hand;margin:0 auto 10px;\" src=\"http:\/\/bp0.blogger.com\/_jye0NzelumM\/R1fcRyLElFI\/AAAAAAAAAEU\/7rUgvOUIzLI\/s320\/NullDate1.GIF\" border=\"0\" \/><\/a>\n<\/p>\n<p>\nLikewise, the same error occurs if you compare a Date element to an empty Character.\n<\/p>\n<p>\n<a href=\"http:\/\/bp2.blogger.com\/_jye0NzelumM\/R1fcJSLElEI\/AAAAAAAAAEM\/xn6akPLSK8U\/s1600-h\/NullDate2.GIF\"><img decoding=\"async\" style=\"display:block;text-align:center;cursor:hand;margin:0 auto 10px;\" src=\"http:\/\/bp2.blogger.com\/_jye0NzelumM\/R1fcJSLElEI\/AAAAAAAAAEM\/xn6akPLSK8U\/s320\/NullDate2.GIF\" border=\"0\" \/><\/a>\n<\/p>\n<p>\nThe simple (but no so obvious) solution is to compare the Date Element to another date element that you know is currently Null.\n<\/p>\n<p>\n<a href=\"http:\/\/bp1.blogger.com\/_jye0NzelumM\/R1fcBCLElDI\/AAAAAAAAAEE\/F0GWB3Ck3K0\/s1600-h\/NullDate3.GIF\"><img decoding=\"async\" style=\"display:block;text-align:center;cursor:hand;margin:0 auto 10px;\" src=\"http:\/\/bp1.blogger.com\/_jye0NzelumM\/R1fcBCLElDI\/AAAAAAAAAEE\/F0GWB3Ck3K0\/s320\/NullDate3.GIF\" border=\"0\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Testing if a Date Element is null within a Formula Element is simple, right? It is not as obvious as you may think. If you attempt to do this by comparing the date to a numeric value of zero you receive the following error when validating the formula \u201cMixed datatypes used as operands. (17000,1768) The\u2026 <span class=\"read-more\"><a href=\"https:\/\/supportingelement.com\/index.php\/2007\/12\/06\/how-to-check-if-a-date-element-is-null\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4,5,8,14,21],"tags":[],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-all-posts","category-configuration","category-date-elements","category-global-payroll","category-null-date","category-peoplesoft"],"_links":{"self":[{"href":"https:\/\/supportingelement.com\/index.php\/wp-json\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supportingelement.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/supportingelement.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/supportingelement.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/supportingelement.com\/index.php\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":0,"href":"https:\/\/supportingelement.com\/index.php\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"wp:attachment":[{"href":"https:\/\/supportingelement.com\/index.php\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/supportingelement.com\/index.php\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/supportingelement.com\/index.php\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}