查詢小總結

2021-08-29 20:43:23 字數 2587 閱讀 3601

if combofield2.text = "上機日期" or combofield2.text = "上機時間" or combofield2.text = "下機日期" or combofield2.text = "下機時間" then

txtcontent2.visible = false

dtpicker2.visible = true

end if

if combofield2.text = "上機日期" or combofield2.text = "下機日期" then

dtpicker2.format = dtpshortdate

dtpicker2.value = cdate(format(dtpicker2.value, "yyyy-mm-dd"))

else

if combofield2.text = "上機時間" or combofield2.text = "下機時間" then

dtpicker2.format = dtptime

else

txtcontent2.visible = true

dtpicker2.visible = false

end if

end if

end sub

private sub command2_click()

dim mrc as adodb.recordset

dim txtsql, msgtext$

txtsql = "select*from line_info "

if not testtxt(combofield1.text) then

msgbox "請選擇欄位名", 48, "提示"

exit sub

else

if not testtxt(comboopsign1.text) then

msgbox "請選擇操作符", 48, "提示"

exit sub

else

if not testtxt(txtcontent1.text) and not testtxt(dtpicker1.value) then

msgbox "請輸入要查詢的內容", 48, "提示"

exit sub

else

if txtcontent1.visible = false then

txtsql = "select*from line_info where " & filedname(combofield1.text) & comboopsign1.text & "'" & dtpicker1.value & " ' "

else

txtsql = "select*from line_info where " & filedname(combofield1.text) & comboopsign1.text & "'" & txtcontent1.text & " ' "

'txtsql = txtsql & filedname(combofield1.text) & " " & comboopsign1.text & " '" & trim(txtcontent1.text) & "'"

end if

end if

end if

end if

if trim(combocombinerelation1.text <> "") then

if trim(combofield2.text) = "" or trim(comboopsign2.text) = "" or (trim(txtcontent2.text) = "" and dtpicker2.value = "") then

msgbox "您選擇了組合關係,請輸入資料之後再查詢", vbokonly, "提示資訊"

exit sub

else

if txtcontent2.visible = false then

txtsql = txtsql & connect(combocombinerelation1.text) & filedname(combofield2.text) & comboopsign2.text & " '" & trim(dtpicker2.value) & "'"

else

txtsql = txtsql & connect(combocombinerelation1.text) & filedname(combofield2.text) & comboopsign2.text & " '" & trim(txtcontent2.text) & "'"

' txtsql = "select*from line_info where " & connect(combocombinerelation1.text) & filedname(combofield2.text) & comboopsign2.text & trim(txtcontent2.text) & ""

end if

end if

end if

Mybatis查詢小總結

在使用mybatis時候,查詢是必不可免的,查詢必定會有查詢條件的產生,在此總結一下,加深下記憶。1.如果只有乙個引數的話,不管是什麼型別,直接傳遞過去,在mybatis的xml檔案中,parametertype指明傳遞過來的引數的型別,然後使用 將引數的直接放在大括號中間就可以了。2.如果有兩個引...

unity 13 小總結 查詢物體和查詢元件

變換元件因為特別常用,所以unity給出了簡易寫法。另外整體原則就是 可以通過乙個遊戲物體獲取它上面的任一元件,可以通過任一元件獲得掛載該元件的遊戲物體。transform 獲取變換元件 getcomponent 獲取其他元件 transform item in transform 注意不能寫成va...

小bug小坑小總結

1.小程式canvas那些原生元件的層級預設是最高的,而且不能更改,平常的div彈框什麼的上面就會顯示出原生元件的內容,解決辦法 cover view,cover image,button share data item item 分享 用這個data item 後的名字可以隨意起,後面的值如果是字...