关于Access数据库中时间存储的问题(急呀)
我在写一个进销存过程中vbshortdate型的日期(如03-8-9)放入到Access中后用datagrid 显示时会显示成09-3-8。其中access数据库中字段的属性为短日期。
代码如下:
strSql = "select * from inlet_product_info where product_type='" & Trim(cmbProducttype1.Text) & "' and product_name='" & Trim(cmbProductname1.Text) & "' and product_num='" & Trim(cmbProductgg1.Text) & "' and product_unit='" & Trim(cmbUnit1.Text) & "' and numbers=" & Trim(txtNumber1.Text) & " and buy_price=" & Trim(txtBuyprice1.Text) & " and buy_date=#" & Trim(dtBuydate1.Value) & "# and product_company='" & Trim(cmbPcompany1.Text) & "' and contain_tax='" & Trim(cmbContaintax1.Text) & "' and total_cost=" & Trim(txtTotalcost1.Text) & " and pay_money='" & Trim(txtPay1.Text) & "' and owe_money=" & Trim(txtOwemoney1.Text) & " and single_price=" & Trim(txtSingleprice1.Text) & " and inlet_name='" & Trim(cmbInletname1.Text) & "' and details='" & Trim(txtDetails1.Text) & "'"
Set recSet = gCnn.Execute(strSql)
其它字段正常只有buy_date(03-8-9)存入数据库后出现问题值为09-3-8
可能是数据库设置出现错误
请高手指点一下为什么年-月-日型的时间存入access短日期型的字段,值为日-年-月