组态王中时间存access怎么存,组态王通过Access数据库起始截止日期查询方法
1)在組態(tài)王畫面中添加兩個(gè)日期時(shí)間控件即:Microsoft Date and Time Picker Control 6.0,控件名稱分別為date1和date2;2)在date1控件的CLOSEUP事件中輸入如下命令語言:long year1;
long month1;
long day1;
year1=date1.Year;
month1=date1.Month;
day1=date1.Day;
string 查詢開始時(shí)間;
if(month1<10&&day1<10)
{
查詢開始時(shí)間=StrFromInt(year1, 10)+"-"+"0"+StrFromInt(month1, 10)+"-"+"0"+StrFromInt(day1, 10);
}
if(month1<10&&day1>=10)
{
查詢開始時(shí)間=StrFromInt(year1, 10)+"-"+"0"+StrFromInt(month1, 10)+"-"+StrFromInt(day1, 10);
}
if(month1>=10&&day1<10)
{
查詢開始時(shí)間=StrFromInt(year1, 10)+"-"+StrFromInt(month1, 10)+"-"+"0"+StrFromInt(day1, 10);
}
if(month1>=10&&day1>=10)
{
查詢開始時(shí)間=StrFromInt(year1, 10)+"-"+StrFromInt(month1, 10)+"-"+StrFromInt(day1, 10); }
\\本站點(diǎn)\開始時(shí)間=查詢開始時(shí)間;
3)在date2控件的CLOSEUP事件中輸入如下命令語言:
long year2;
long month2;
long day2;
year2=date2.Year;
month2=date2.Month;
day2=date2.Day;
string 查詢結(jié)束時(shí)間;
if(month2<10&&day2<10)
{
查詢結(jié)束時(shí)間=StrFromInt(year2, 10)+"-"+"0"+StrFromInt(month2, 10)+"-"+"0"+StrFromInt(day2, 10);
}
if(month2<10&&day2>=10)
總結(jié)
以上是生活随笔為你收集整理的组态王中时间存access怎么存,组态王通过Access数据库起始截止日期查询方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php实现tail,Linux-如何用p
- 下一篇: oracle安装参数,Oracle安装内