What is the T-SQL equivalent for ANSI-SQL substr?

G

Guest

The field "AccountNum" is 21 characters long. The department number is
imbedded in the "AccountNum" field beginning in position 8 for 4 characters.
In an Access SQL view I am trying to use the SQL substring function but
Access query does not recognize it. substr([tablename.AccountNum],8,4) as
DeptNum
Does Access query have an equivalent expression to create the same results
as a substr function?
 
R

Rick Brandt

Don said:
The field "AccountNum" is 21 characters long. The department number is
imbedded in the "AccountNum" field beginning in position 8 for 4
characters. In an Access SQL view I am trying to use the SQL
substring function but Access query does not recognize it.
substr([tablename.AccountNum],8,4) as DeptNum
Does Access query have an equivalent expression to create the same
results as a substr function?

Mid()

The arguments are identical to Substring().
 
V

Van T. Dinh

.... and BTW, the default SQL flavour in Access is JET SQL, not T-SQL. T-SQL
is the name of Microsoft SQL Server SQL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top