Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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.


Ïà¹ØÎÊ´ð£º

ÃÅÍ⺺ÇóÖú...¹ØÓÚºǫ́+SQL+ASP

....½Óµ½Ò»¸öС³ÌÐò..¹¤×÷Ô­À´´ó¸ÅÊÇÕâÑùµÄ...ǰ̨ÊÇWEB·þÎñÆ÷.¼Ü¹¹¾ÍÊÇASP+SQL..ǰ̨ÓÉASPÏòSQLÌí¼Ó·þÎñÀà±ð(±íµ¥).È»ºóÓÖºǫ́³ÌÐò¶ÁÈ¡±íµ¥..Ҫʵʱ¶ÁÈ¡..È»ºóÏÔʾÔÚ·þÎñÆ÷ÉÏÃæ..´ÓÀíÂÛÉÏÃæÄÜÐÐͨ²»?Èç¹û¿ÉÒÔ..ºǫ́ ......

¹ØÓÚgroup byµÄsqlÓï¾ä£¿

  with adod_dict do
    begin
    close;
    commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......

sql Óï¾äÓÅ»¯ ÎÊÌ⣿ ÇóÖú£¡

SELECT ×Ö¶Î1
  from ±í  WHERE (...) AND ×Ö¶Î1=function()

×Ö¶Î1ÓпÉÄܵÄÖµ Ϊ 0 »òÕß -1
  function ·µ»Ø 0 »òÕß -1

ÕâÑùµÄËÙ¶ÈÌ«ÂýÁË  Çë¸ßÊÖ°ïæ
¶¨£¡


ÎÒд³ ......

vbÖ´ÐÐaccess sqlÓï¾ä¹ÖÎÊÌâ

SELECT Count(*) from In_fo WHERE Reader_Time between #" + time1 + "# AND #" + time2 + "# and id=" + userid + ";

ÉÏÃæÊÇÎÒдµÄsqlÓï¾ä Reader_TimeÊÇʱ¼äÀàÐÍ idΪÊý×Ö ......

sql server2005¿ÉÒÔÓësql server 2000¹²´æÂð£¿

×îÏÈϵͳװÓÐsql2000£¬ÀïÃæÒ²ÔËÐÐÁ˺öàÍøÕ¾Êý¾Ý¿âÓ¦ÓóÌÐò£¬ÏÖÔÚÓиöÍøÕ¾ÐèÒªÅÜÔÚsql server2005ƽ̨ÉÏ£¬ÇëÎÊÎÒ¿ÉÒÔÖ±½ÓÔÚÕâ¸ö°²×°ÓÐsql server2000µÄ·þÎñÆ÷ÉÏÖ±½Ó°²×°sql server2005Â𣿻᲻»áÁ½¸ö°æ±¾µÄ·¢Éú¼æÈÝÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ