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

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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().
 
.... and BTW, the default SQL flavour in Access is JET SQL, not T-SQL. T-SQL
is the name of Microsoft SQL Server SQL.
 
Back
Top