数据库查询的问题 我在VB里面用过的,就是用的字符串,当然在VB里面还要加#号的。like : #2001-08-12# 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tablewhere datetime=#2002-12-12# 微软的数据库系统VFP,Access,SQL Server都可表示为#YYYY-MM-DD# 老兄的意思就是在VC中也可这样写?#YYYY-MM-DD#?? 当然。#YYYY-MM-DD#这种表示在放在sql中的。比如DAO操作mdb.CDaoDatabase db;db.Open("xx.mdb");db.Execute("insert into tablename (start_time) values (#2002-02-04#)");db.Close(); CString sql; CString starttime,endtime,strTemp; strTemp.Format("%s%d","",m_dateFrom.GetMonth()); starttime=strTemp+"/"; strTemp.Format("%s%d","",m_dateFrom.GetDay()); starttime=starttime+strTemp+"/"; strTemp.Format("%s%d","", m_dateFrom.GetYear() ); starttime=starttime+strTemp; strTemp.Format("%s%d","",m_dateTo.GetMonth()); endtime=strTemp+"/"; strTemp.Format("%s%d","",m_dateTo.GetDay()); endtime=endtime+strTemp+"/"; strTemp.Format("%s%d","", m_dateTo.GetYear() ); endtime=endtime+strTemp; sql="select distinct PaperCode from tblhardware where datediff('d','"+starttime+"',drawdate)>=0 and datediff('d',drawdate,'"+endtime+"')>=0"; 以上代码在中英文下均好用 以上的m_dateFrom,m_dateTo军为COleDateTime型变量 bmp32转化为bmp24 两个子对话框如何互相访问数据 求DirectShow学习方法[内详] OLE 问题 文件读写中的一些问题 SQLserver2000查询最新增加的20条数据的语句怎么写? 祝愿广大程序员都幸福!散分散分! 请问哪里可以下载图标库(小的),急用!在线等待 重定向后怎么前面出来这么多的"0"????? 转载到我最常来asm版块! 用vc++6怎么编译标准c和c++的程序呀?vc怎么设置呀? Re:我给对话框加上了最大化最小化按钮,但是最大化一次再恢复,圆就画到窗口外了,最小化再恢复又好了,谁解释一下
where datetime=#2002-12-12#
比如DAO操作mdb.CDaoDatabase db;
db.Open("xx.mdb");
db.Execute("insert into tablename (start_time) values (#2002-02-04#)");
db.Close();
CString starttime,endtime,strTemp;
strTemp.Format("%s%d","",m_dateFrom.GetMonth());
starttime=strTemp+"/";
strTemp.Format("%s%d","",m_dateFrom.GetDay());
starttime=starttime+strTemp+"/";
strTemp.Format("%s%d","", m_dateFrom.GetYear() );
starttime=starttime+strTemp;
strTemp.Format("%s%d","",m_dateTo.GetMonth());
endtime=strTemp+"/";
strTemp.Format("%s%d","",m_dateTo.GetDay());
endtime=endtime+strTemp+"/";
strTemp.Format("%s%d","", m_dateTo.GetYear() );
endtime=endtime+strTemp; sql="select distinct PaperCode from tblhardware where datediff('d','"+starttime+"',drawdate)>=0 and datediff('d',drawdate,'"+endtime+"')>=0";
以上代码在中英文下均好用