Guest User

Guest User

  • Tech Writer
  • 13
  • 0

MS SQL If Substring and EXPR1

Jan 31 2013 11:20 AM
Hi All, I am porting an old MS access system to MS SQL and I am having a slight problem porting the SQL code to the server.

I am using a View in MS SQL server.
I have cust the expression down to just the one field I am trying to deal with, however I am having a few syntax problems, could someone possibly help me?

SELECT Ship_To, If(Substring([Ship_To],1,2)="05","BMW","") AS Expr1
FROM Master;

This is very easy to do in MS Access, I am unsure what I am doing wrong!

Answers (2)