Tags: birthdate, date, empty, example, field, filled, numeric, programming, sql, table1

Test for empty date field

On Programmer » SQL

1,830 words with 3 Comments; publish: Thu, 29 May 2008 04:03:00 GMT; (200109.38, « »)

How do I test whether data has been filled into a date or numeric field?

For example, using

WHERE (((Table1.BirthDate)=''));

does not work. (It gives a 'data type mismatch in criteria expression'

error)

Andrew Spencer

All Comments

Leave a comment...

  • 3 Comments
    • WHERE columnName IS NULL ?

      --

      http://www.aspfaq.com/

      (Reverse address to reply.)

      "Andrew Spencer" <andrew.sql.questionfor.info.diel.co.za> wrote in message

      news:chsf1c$5ja$1.sql.questionfor.info.ctb-nnrp2.saix.net...

      > How do I test whether data has been filled into a date or numeric field?

      > For example, using

      > WHERE (((Table1.BirthDate)=''));

      > does not work. (It gives a 'data type mismatch in criteria expression'

      > error)

      > Andrew Spencer

      >

      #1; Thu, 29 May 2008 04:04:00 GMT
    • WHERE Table1.BirthDate IS NULL

      ?

      Roji. P. Thomas

      Net Asset Management

      https://www.netassetmanagement.com

      "Andrew Spencer" <andrew.sql.questionfor.info.diel.co.za> wrote in message

      news:chsf1c$5ja$1.sql.questionfor.info.ctb-nnrp2.saix.net...

      > How do I test whether data has been filled into a date or numeric field?

      > For example, using

      > WHERE (((Table1.BirthDate)=''));

      > does not work. (It gives a 'data type mismatch in criteria expression'

      > error)

      > Andrew Spencer

      >

      #2; Thu, 29 May 2008 04:05:00 GMT
    • You can use the function isdate() to check if the value

      being tested is a valid date or not

      WHERE ISDATE(Table1.BirthDate)= 1 -- a valid date

      >--Original Message--

      >How do I test whether data has been filled into a date or

      numeric field?

      >For example, using

      >WHERE (((Table1.BirthDate)=''));

      >does not work. (It gives a 'data type mismatch in

      criteria expression'

      >error)

      >Andrew Spencer

      >

      >.

      >

      #3; Thu, 29 May 2008 04:06:00 GMT