How to format date in a SQL query?

前端 未结 3 909
情书的邮戳
情书的邮戳 2021-01-27 09:50

Hello I\'m using MS JET OLEDB 4.0 on VBA (MS ACCESS)

SQL = \"SELECT COUNT(Date) FROM [Orders] WHERE [Orders].[Date] BETWEEN \" & \"#\" & StartDate &          


        
3条回答
  •  忘掉有多难
    2021-01-27 10:41

    I have noticed from the SQL compilation of the query when using Between, that it turns it to MM/DD/YYYY and it did not work till I used Format(startdate, "mm/dd/yyyy"). Please check the snapshop.

提交回复
热议问题