Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VB的時間查詢...

0 views
Skip to first unread message

oln...@bbs.mgt.ncu.edu.tw

unread,
Mar 14, 1999, 3:00:00 AM3/14/99
to

有沒有人知道在VB中,如何在資料庫中下條件查詢時間

例如:日期是使用者要輸入的(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

高木雅史

unread,
Mar 15, 1999, 3:00:00 AM3/15/99
to
《 在 oln...@bbs.mgt.ncu.edu.tw ( ) 的大作中提到: 》
: 有沒有人知道在VB中,如何在資料庫中下條件查詢時間

: 例如:日期是使用者要輸入的(text1.text)
: 現在條件就是此日期(text1.text)去資料庫查詢
: 請問這在VB中的程式要怎麼寫啊??
: 底下的text1.text是number而非日期,請問要怎麼寫,才能查日期啊??
: Data1.RecordSource = "select * from employee where number=" & chr(39) & text1.text & chr(39)
: Data1.Refresh
: 謝謝!!!!!

使用Cdate()的含數就可以將資料型態轉換為日期了....

--
[m [1;35m※ 來源:‧蛋捲廣場 bbs.tku.edu.tw‧[FROM: 163.13.241.216] [m

想改題目喔

unread,
Mar 15, 1999, 3:00:00 AM3/15/99
to
==> 在 oln...@bbs.mgt.ncu.edu.tw ( ) 的文章中提到:

> 有沒有人知道在VB中,如何在資料庫中下條件查詢時間
> 例如:日期是使用者要輸入的(text1.text)
> 現在條件就是此日期(text1.text)去資料庫查詢
> 請問這在VB中的程式要怎麼寫啊??
> 底下的text1.text是number而非日期,請問要怎麼寫,才能查日期啊??
> Data1.RecordSource = "select * from employee where number=" & chr(39) & text1.text & chr(39)
> Data1.Refresh
> 謝謝!!!!!


如果輸入的 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>

0 new messages