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