例如:日期是使用者要輸入的(text1.text)
現在條件就是此日期(text1.text)去資料庫查詢
請問這在VB中的程式要怎麼寫啊??
底下的text1.text是number而非日期,請問要怎麼寫,才能查日期啊??
Data1.RecordSource = "select * from employee where number=" & chr(39) & text1.text & chr(39)
Data1.Refresh
謝謝!!!!!
--
◎ [1;31m龍 [32m貓 [33m資 [34m訊 [35m天 [36m地 [0m( [1mbbs.mgt.ncu.edu.tw [0m)
◎[ [1;33;46moln [0m]來自: 140.115.213.81
使用Cdate()的含數就可以將資料型態轉換為日期了....
--
[m [1;35m※ 來源:‧蛋捲廣場 bbs.tku.edu.tw‧[FROM: 163.13.241.216] [m
如果輸入的 text format ==> '9999/99/99' that's no problem..
else u can transfer to '9999/99/99' format
and then data1.recordsource = "select .......number=date(text1.text)"
--
* Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3>