简体   繁体   中英

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)));

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM