SqlSever:
select b.stuffname,a.corname,b.age,b.qq,b.email,b.mp from tempclient a ,tempclient b where a.corno = b.corno and a.userid=1 and substring(AGE,9,10) = '04'
/**注释**/
substring(AGE,9,10) = '04' ----截取2007-03-25 第九位和第十位25,这和java的不同。
Access:Left(RQ,4)
select count(*) from sgt where 1=1 and Left(RQ,4) = '2008'
返回:Variant (String),其中包含字符串中从左边算起指定数量的字符。
语法:
Left(string, length)
Left函数的语法有下面的命名参数:
部分说明
string 必要参数。字符串表达式其中最左边的那些字符将被返回。如果 string 包含 Null,将返回 Null。
length 必要参数;为 Variant (Long)。数值表达式,指出将返回多少个字符。如果为 0,返回零长度字符串 ("")。如果大于或等于 string 的字符数,则返回整个字符串。
说明
欲知 string 的字符数,使用 Len 函数。
注意 LeftB 函数作用于包含在字符串中的字节数据。所以 length 指定的是字节数,而不是要返回的字符数。