开发者

MSAccess: type mismatch in date column for sql query

开发者 https://www.devze.com 2022-12-13 21:11 出处:网络
In ms-access database i have a table named tableA this table has a column called Call_Date which has 4 types of entri开发者_如何转开发es

In ms-access database i have a table named tableA

this table has a column called Call_Date which has 4 types of entri开发者_如何转开发es

  1. dates ( e.g 10/23/2008 )
  2. -
  3. NA
  4. Blanks ( empty cell )

how can i write a query to select all rows of tableA except those where the Call_Date column has - or NA or Blanks

i tried writing

Select * from tableA where Call_Date not in ('-','NA',' ');

but its giving type mismatch error.


I am assuming that Call_Date must be string type in the table.

Select * from tableA where IsDate(Call_Date) = true


You could try casting the Call_Date field as a string

Select * from tableA where Cstr(Call_Date) not in ('-','NA',' ');

Although I would think the datatype of Call_Date should be string if it can have all those entries

0

精彩评论

暂无评论...
验证码 换一张
取 消