MS Access SQL中是否有与SUBSTRING功能等效的功能? [英] Is there an equivalent to the SUBSTRING function in MS Access SQL?

查看:60
本文介绍了MS Access SQL中是否有与SUBSTRING功能等效的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在MS Access查询中执行类似的操作,但是SUBSTRING是未定义的函数.

I want to do something like this within an MS Access query, but SUBSTRING is an undefined function.

SELECT DISTINCT SUBSTRING(LastName, 1, 1)
FROM Authors;

推荐答案

您可以使用VBA字符串函数(如@onedaywhen在注释中指出的那样,它们并不是真正的VBA函数,而是MS Jet库中的等效函数)就功能签名而言,即使它们不需要MS Access的实际存在,它们也将被调用并以相同的方式工作.):

You can use the VBA string functions (as @onedaywhen points out in the comments, they are not really the VBA functions, but their equivalents from the MS Jet libraries. As far as function signatures go, they are called and work the same, even though the actual presence of MS Access is not required for them to be available.):

SELECT DISTINCT Left(LastName, 1)
FROM Authors;

SELECT DISTINCT Mid(LastName, 1, 1)
FROM Authors;

这篇关于MS Access SQL中是否有与SUBSTRING功能等效的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆