sql ÎÊÌâ
PBÖпª·¢µÄ¡£
DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)
string sql
sql = dw_1.GetSQLSelect()+"Where (StartTime> '"+startTime+"') and (EndTime < '"+endTime+"')"
ÕâÑùдÓÐÎÊÌâÂð£¬StartTime, EndTimeÔÚÊý¾Ý¿âÖÐÊÇdatetimeÀàÐÍ
×îºÃÓòÎÊý»¯µÄÐÎʽд.
PB²»¶®£¡Â¥Ï¼ÌÐø
ÄܾٸöÀý×ÓÂð£¬Ð»Ð»
C# code:
string sql = xx + " where startTime > @startTime and EndTime < @endTime";
SqlCommand cmd = new SqlCommand(sql,con);
cmd.Parameters.Add("@startTime",SqlDbType.DateTime);
cmd.Parameters.Add("@endTime",SqlDbType.DateTime);
cmd.Parameters["startTime"].Value = xx;
cmd.Parameters["endTime"].Value = xx;
cmd.ExecuteNonQuery();
PBÀïÃæ¿ÉÒÔÕâôÓÃô£¿/СÁº´ó´ó
DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)
--MSSQL
string sql
sql = dw_1.GetSQLSelect()+" Where (StartTime> '"+em_1.Text+"') and (EndTime < '"+em_2.Text+"')"
SQL code
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.
Ïà¹ØÎÊ´ð£º
....½Óµ½Ò»¸öС³ÌÐò..¹¤×÷ÔÀ´´ó¸ÅÊÇÕâÑùµÄ...ǰ̨ÊÇWEB·þÎñÆ÷.¼Ü¹¹¾ÍÊÇASP+SQL..ǰ̨ÓÉASPÏòSQLÌí¼Ó·þÎñÀà±ð(±íµ¥).È»ºóÓÖºǫ́³ÌÐò¶ÁÈ¡±íµ¥..Ҫʵʱ¶ÁÈ¡..È»ºóÏÔʾÔÚ·þÎñÆ÷ÉÏÃæ..´ÓÀíÂÛÉÏÃæÄÜÐÐͨ²»?Èç¹û¿ÉÒÔ..ºǫ́ ......
sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001
ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......
ÔÚ΢Èí¹Ù·½ÏÂÔØÁËÒ»¸ösqljdbc_2.0Çý¶¯°ü£¬ÏëÓÃsqlserver2008Á¬½Ó¡£µ«×ÜÊÇÔÚÁ¬½ÓÊý¾Ý¿âʱÌáʾ³ö´í£¨ÓÐÒ»µãҪ˵Ã÷µÄÊÇÎҵĵçÄÔÀïÓÐÁ½¸öÊý¾Ý¿â°æ±¾Ò»¸öÊÇsqlserver2005(ĬÈϵÄʵÀý)»¹ÓÐÒ»¸ö¾ÍÊÇsqlserver2008(ÐèÒªÖ¸¶¨Ê ......
Ç°¼¸Ì칫˾ÃæÊÔ£¬¼ûµ½Ò»Ìâ,Çë¸ßÊÖ°ïÎÒ½â´ð£¬Ð»Ð»£¡
ÄÚÈÝtable:
id name parentid
1 aaa null
14 bbb 1
......
SELECT Count(*) from In_fo WHERE Reader_Time between #" + time1 + "# AND #" + time2 + "# and id=" + userid + ";
ÉÏÃæÊÇÎÒдµÄsqlÓï¾ä Reader_TimeÊÇʱ¼äÀàÐÍ idΪÊý×Ö ......