0
Dim query As String = "SELECT * FROM table WHERE column CONTAIN DAYOFWEEK(CURDATE())"

The DateType of the column is VARCHAR and the data is number with comma like "0,1,2,4,5"

Example today is Friday DAYOFWEEK(CURDATE()) will return 6 how can I check if the column contain 6?

vbnewbie
  • 206
  • 6
  • 26
  • You really should normalize your table schema so you don't have a comma-separated list in the first place. But see the linked question for how to use `FIND_IN_SET()` to do what you want. – Barmar Apr 13 '17 at 15:54
  • @Barmar thanks this work for me FIND_IN_SET(DAYOFWEEK(CURDATE()),column)>0 – vbnewbie Apr 13 '17 at 16:10
  • select * from test where testcolumn like Concat('%',DAYOFWEEK(CURDATE()),'%') would work too – Kevin Apr 13 '17 at 16:42

0 Answers0