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

sql server 2000 ÈÕÆÚº¯Êý£¨Áª»ú°ïÖú£©

1.DATEADDº¯Êý
  ÔÚÏòÖ¸¶¨ÈÕÆÚ¼ÓÉÏÒ»¶Îʱ¼äµÄ»ù´¡ÉÏ£¬·µ»ØÐ嵀 datetime Öµ¡£
Óï·¨
DATEADD ( datepart , number, date )
²ÎÊý
datepart
ÈÕÆÚ²¿·Ö
Ëõд
Year
yy, yyyy
quarter
qq, q
Month
mm, m
dayofyear
dy, y
Day
dd, d
Week
wk, ww
Hour
hh
minute
mi, n
second
ss, s
millisecond
ms
2. DATEDIFFº¯Êý
·µ»Ø¿çÁ½¸öÖ¸¶¨ÈÕÆÚµÄÈÕÆÚºÍʱ¼ä±ß½çÊý
²ÎÊý
 datepart
Êǹ涨ÁËÓ¦ÔÚÈÕÆÚµÄÄÄÒ»²¿·Ö¼ÆËã²î¶îµÄ²ÎÊý¡£
ͬÉÏ
 
²âÊÔÊý¾Ý£º
if object_id('mma') is not null drop table mma
go
create table mma(mydate datetime)
go
insert into mma
select '20090203' union all
select '20090205' union all
select '20090209' union all
select '20091231' union all
select '20100102' union all
select '20100112' union all
select '20100116'
 
--²éѯ·µ»Ø±¾ÔµļǼ
·½·¨Ò»
select mydate from mma where datediff(m,mydate,getdate())=0(×¢µ±Ç°ÈÕÆÚÊÇ20100116)
·½·¨¶þ
SELECT * from mma WHERE CONVERT(CHAR(6), mydate,112)=CONVERT(CHAR(6),GETDATE(),112)
·½·¨Èý
select mydate from aa where substring(convert(varchar(20),getdate(),120),0,8)=substring(convert(varchar(20),mydate,120),0,8)


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......

ÔÚSQL Server 2005Êý¾Ý¿âÖÐʵÏÖ×Ô¶¯±¸·Ý

µÚ1ÖÖ·½·¨£º
ÆóÒµ¹ÜÀíÆ÷
  --¹ÜÀí
  --ÓÒ¼üÊý¾Ý¿âά»¤¼Æ»®
  --н¨Î¬»¤¼Æ»®
  --<ÏÂÒ»²½>
  --Ñ¡ÔñÄãÒª±¸·ÝµÄÊý¾Ý¿â
  --<ÏÂÒ»²½>Ö±µ½"Ö¸¶¨Êý¾Ý¿â±¸·Ý¼Æ»®"ÕâÏî
  --Ö¸¶¨´æ´¢±¸·ÝÎļþµÄλÖÃ,ÕâÀï¸ù¾ÝÐèҪѡÔñ±¸·Öµ½´Å´ø»¹ÊÇ´ÅÅÌ
  --µ¥»÷µ÷¶ÈºóÃæµÄ"¸ü¸Ä"°´ ......

SQL×¢Èë½Ì³ÌÖ®ÈëÃÅƪ

Èë Êƪ
Èç¹ûÄãÒÔǰûÊÔ¹ýSQL×¢ÈëµÄ»°£¬ÄÇôµÚÒ»²½ÏÈ°ÑIE²Ëµ¥=>¹¤¾ß=>InternetÑ¡Ïî=>¸ß¼¶=>ÏÔʾÓѺà HTTP ´íÎóÐÅϢǰÃæµÄ¹´È¥µô¡£·ñÔò£¬²»ÂÛ·þÎñÆ÷·µ»Øʲô´íÎó£¬IE¶¼Ö»ÏÔʾΪHTTP 500·þÎñÆ÷´íÎ󣬲»ÄÜ»ñµÃ¸ü¶àµÄÌáʾÐÅÏ¢¡£
µÚÒ»½Ú¡¢SQL×¢ÈëÔ­Àí
ÒÔÏÂÎÒÃÇ´ÓÒ»¸öÍøÕ¾www.19cn.com¿ªÊ¼£¨×¢£º±¾ÎÄ·¢±íÇ°ÒÑÕ÷µ ......

Êý¾Ý¿âÏà¹Ø£ºJDBCÖ±Á¬SQL Server 2005

À´×Ô:http://www.cnblogs.com/mikeye/archive/2007/04/13/711878.html
ºÍÀ´×Ô:http://tech.ccidnet.com/art/3539/20080225/1370107_1.html
ÓÃeclipseÀ´½øÐÐMicrosoft SQL Server 2005Êý¾Ý¿â·½ÃæµÄ¿ª·¢£¬ÏÈ°ÑMS SQL Server 2005 JDBC DriverµÄÇý¶¯ÏÂÔغó¼ÓÈ빤³ÌÎļþµÄÀà¿âÖУ»È»ºóдURL×Ö·û´®¡£¸ù¾ÝÒÔÍùµÄд·¨Ð´È룺url = ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ