accessÓëSqlServer ֮ʱ¼äÓëÈÕÆÚ¼°ÆäËüSQLÓï¾ä±È½Ï
1¡¢Datediff£º
1.1Ëã³öÈÕÆڲ
1.access: datediff('d',fixdate,getdate())
2.sqlserver: datediff(day,fixdate,getdate())
ACCESSʵÀý£º select * from table where data=datediff('d',fixdate,getdate())
sqlserverʵÀý£º select * from table where data=datediff(day,fixdate,getdate())
1.2Ëã³öʱ¼ä²î£º
1.access: datediff('h',fixdate,getdate())
2.sqlserver: datediff(Hour,'2004-12-10',getdate())
ACCESSʵÀý£º select DATEDIFF('h',HMD,getdate())
sqlserverʵÀý£º select datediff(Hour,'2004-12-10',getdate())
1.3Ëã³öÔ·ݲ
1.access: datediff('m',fixdate,getdate())
2.sqlserver: datediff(Month,'2004-12-10',getdate())
ACCESSʵÀý£º select DATEDIFF('m',HMD,getdate())
sqlserverʵÀý£º select datediff(Month,'2004-12-10',getdate())
----------------------------------------------------------------------------
2¡¢ÈÕÆÚ±äÁ¿
1.access: #"&data&"#
2.sqlserver: '"&data&"'
ACCESSʵÀý£º select * from table where data=#"&data&"#
sqlserverʵÀý£º select * from table where data='"&data&"'
----------------------------------------------------------------------------
3¡¢ÊÇ·ñ
1.access: not finished
2.sqlserver: finished=0
ACCESSʵÀý£º select * from table where not finished
sqlserverʵÀý£º select * from table where finished=0
----------------------------------------------------------------------------
4¡¢ÇóÓàÊý
1.access: a mod b£½100
2.sqlserver: a % b £½100
ACCESSʵÀý£º select a mod b£½100 from table where not finished
sqlserverʵÀý£º select a % b £½100 from table where finished=0
-----------------------------------
Ïà¹ØÎĵµ£º
¶àÌõ¼þ²éѯ´æ´¢¹ý³Ì
¶àÌõ¼þ²éѯ´æ´¢¹ý³Ì ÀýÒ»
create proc pr_select_Natural
(
@CDATE datetime,
@FAC_NAME varchar(50),
@BATTERY_TYPE varchar(20),
@MAKE_MODE varchar(20),
@PRODUCE_MODE varchar(20),
@YEAR char(4),
@MONTH char(2 ......
SQL Server×Ö·û´®´¦Àíº¯Êý´óÈ«
selectÓï¾äÖÐÖ»ÄÜʹÓÃsqlº¯Êý¶Ô×ֶνøÐвÙ×÷£¨Á´½Ósql server£©£¬
select ×Ö¶Î1 from ±í1 where ×Ö¶Î1.IndexOf("ÔÆ")=1;
ÕâÌõÓï¾ä²»¶ÔµÄÔÒòÊÇindexof£¨£©º¯Êý²»ÊÇsqlº¯Êý£¬¸Ä³Ésql¶ÔÓ¦µÄº¯Êý¾Í¿ÉÒÔÁË¡£
left£¨£©ÊÇsqlº¯Êý¡£
select ×Ö¶Î1 from ±í1 where charindex£¨'Ô ......
Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06
Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16
Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06
Select CONVERT(varchar(100), GETDATE(), 4): 16.05.06
Select CONVERT(varch ......