Skip to content
Advertisement

Convert specific MS Access query to SQL Server query

I have MS Access query and try to convert to SQL Server query.

Please someone can help me.

UPDATE AppReferrals
SET AppReferrals.DeviceID = CLng(Val(Left(IIf([AppReferrals].[DeviceID] Like '0',[AppReferrals].[ActionID],[AppReferrals].[DeviceID]),9)));

Advertisement

Answer

Good I think I’m very old

I worked with Visual basic in my first job 20 years ago

basically what you are doing is taking a value “first 9 digit” (DeviceID) and this is null the alternative (ActionID) and converting it to an Long value

using the following functions

  1. CLng
  2. Val
  3. Left
  4. IIf
  5. Like

Example in visual basic net the function

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement