Oracle use LIKE '%' on DATE

后端 未结 8 2006
灰色年华
灰色年华 2021-01-12 02:52

My table myTab has the column startDate, which has the datatype \"DATE\". The data in this column are stored like dd.mm.yyyy.

8条回答
  •  一个人的身影
    2021-01-12 03:06

    I solved my problem that way. Thank you for suggestions for improvements. Example in C#.

    string dd, mm, aa, trc, data;
    dd = nData.Text.Substring(0, 2);
    mm = nData.Text.Substring(3, 2);
    aa = nData.Text.Substring(6, 4);
    trc = "-";
    data = aa + trc + mm + trc + dd;
    
    "Select * From bdPedidos Where Data Like '%" + data + "%'";
    

提交回复
热议问题