Having trouble converting a MS Access IIF statement into SQL Sever 2012

I am in the process of converting an Access Database to SQL Server 2012.
The statement that works in MS Access currently right now is
 IIf([$$AMTP46 WITH LAST DRG]![LastOfMSDRG] Is Not Null,[$$AMTP46 WITH LAST DRG]![LastOfMSDRG],[$$AMTP46]![Billing DRG])
I am not SQL Savvy, can you please help me find a solution to using this IIF statement in SQL. I have tried the CASE statements and no luck there either.
Thanks

I presume that you check if LastDRG column is not null then use LastDRG or else use LastOfMSDRG column
You may also show your case query which didn't work for you.
Meanwhile try below:
-- Option 1
SELECT CASE WHEN [LastOfMSDRG] IS NOT NULL
THEN [LastOfMSDRG]
ELSE [Billing DRG]
END AS 'Output'
FROM YourTable
-- Option 2
SELECT COALESCE([LastOfMSDRG], [Billing DRG])
FROM YourTable
-Vaibhav Chaudhari

Similar Messages

  • Import MS Access 2013 tables into SQL Server 2012

    Hi there,
    Is there a step by step example somewhere showing how to import an MS Access 2013 table into SQL Server 2012?
    I have read the existing posts and don't see a definitive answer.
    I have installed MS Access 2010 engine, first 32 bit then 64 bit.
    I have installed the MS Access 2013 runtime on my server.
    I use the Office 2015 Access Database Engine OLE DB Provider.
    I get the error:
    Error 0xc0202009: Source - APEntries [1]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E37.
    Error 0xc02020e8: Source - APEntries [1]: Opening a rowset for "`TableName`" failed. Check that the object exists in the database.
    The post regarding the above errors doesn't resolve the issue.
    I have full administrative permissions on the server.
    What is the trick to making this work?
    Thanks,
    Ric
    Ric Miller

    Hi there,
    I tried the exact same operation on a third machine.
    This machine has Windows 8.1 64 bit, SQL Server 2012 64 bit, MS Office 2013 Plus 32 bit.
    I am the administrator on this machine.
    I installed this:
    Microsoft Access Database Engine 2010 Redistributable 32 bit (because I have MS Office 2013 plus 32 bit installed.)
    From here:
    http://www.microsoft.com/en-us/download/details.aspx?id=13255
    It won't let me install the 64 bit version without uninstalling MS Office 32 bit.
    I created an MS Access database on this machine using MS Access 2013 and created a table with 3 records.
    I used the "Import and Export Data (32 bit)" from the start menu.
    After I installed the "Database Engine 2010 32 bit" driver above, I now have the option of "Office 2015 Access Database Engine OLE DB Provider" as Data Source which I did not have prior to doing this installation.
    I selected the driver and added the Properties of the Data Source Name file location of the MS Access file. I am using a blank password.
    I go thru the same sequence of selecting a table to import and after running the result is the same:
    Error 0xc0202009: Source - APEntries [1]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E37.
    "Error 0xc02020e8: Source - APEntries [1]: Opening a rowset for "`TableName`" failed. Check that the object exists in the database."
    This seems to be consistent across three machines with three operating systems with the same files and the same result.
    I understand that some people have gotten this to work.
    I would appreciate it if anyone can report an error in the above procedure to me.
    Thanks,
    Ric
    Ric Miller

  • I'm having troubles converting my raw files from Nikon D5200 (NEF) to DNG. I tried using Lightroom 4, but it didn't identify the folder containing the files. So i downloaded the latest DNG converter but that too didn't identify the files kept in the folde

    I'm having troubles converting my raw files from Nikon D5200 (NEF) to DNG. I tried using Lightroom 4, but it didn't identify the folder containing the files. So i downloaded the latest DNG converter but that too didn't identify the files kept in the folder location. So I downloaded DNG converter v7.3 for D5200. It identifies the folder and files; but it is giving me parsing error on trying to convert files. I'm running Windows Vista Home Edition SP1. Kindly advise. Thank you.

    I probably missed this detail in what you’ve posted, but do you see the thumbnails of the three cameras’ raw files in Finder if you don’t convert to DNG?
    What has happened in the past is that the Apple raw interpreter doesn’t read thumbnails of DNGs it doesn’t like, where at least one thing it didn’t used to like was embedded lens corrections for mirrorless cameras.  Are the Olympus and Panasonic mirrorless—meaning there is no optical viewfinder and everything is seen on an LCD screen or perhaps an electronic view finder?  If so the reason these are different is that the camera is doing the lens distortion corrections automatically and this information is stored in the raw files and in the DNGs but Apple doesn’t know how to use these embedded lens corrections or doesn’t know how to read the newer DNG spec that does allow for this information to be embedded in the DNG, at least.
    Apple could just extract the embedded jpg preview and ignore the other parts of the file it doesn’t understand, but it apparently doesn’t do this.
    What I’m not sure about is if the Apple raw interpreter still has this problem or if you’re on an older system without the latest updates for camera raw decoding by Apple.

  • I'm having trouble converting my RAW files to jpegs. Even though my RAW files are 90MB plus, the jpegs when converted are only around 6MB.  Am I doing something wrong?  Thanks,  A

    Dear Forum,
    I realise this isn’t necessarily your problem, buy I’m having trouble converting my RAW files to jpegs.
    Even though my RAW files are 90MB plus, the jpegs when converted are only around 6MB.
    Am I doing something wrong?
    Thanks,
    A

    HHi Barbara, thanks for replying to my post.
    No there's nothing wrong with the Jpegs, but I want to srart uploading images for sale in Alamy, but they say they must be a minimum of 17mb un compressed. Does that mean that at 6mb compressed from 90mb they'd be acceptable?
    thanks,
    alex

  • Having trouble converting array to spreadsheet string, storing the file and coverting back to array with complex numbers

    I am working with a network analyzer. I have arrays made of 5 columns the first consisting of an integer and the next four consisting of complex numbers. I am converting the array into a spreadsheet string and then saving the file using the write characters to a file VI. That seems to work well as when I open the file in Excel all the data is there. However when I try to reverse the process, open file and convert back to array, I loose some of the data. Specifically the imaginary parts of my complex numbers are all going to zero. I have narrowed down the problem to be in the conversion from spreadsheet string to array and vice versa. I
    think the problem may be with the 'format' input to the VI. I do not have an adequate resource for this so I am not sure what to put in to accomplish my task. Any takers?

    Hi Biz
    I don't think there is a direct way of converting a complex number to a
    string, so when you convert the array to a spreadsheet string, the
    numbers would be converted to real data.
    However, you could try separating the real and imaginary parts using the
    "Numeric: Complex to Re/Im" function, and then store these - either in
    separate files or in adjacent columns/rows in the same file. Then, when
    you read in the data again, use the "Numeric: Re/Im to Complex" function
    to put the two "halves" together.
    If you actually want Excel to interpret the numbers as imaginary, then
    you'll probably want to create a string for each complex number of the
    form "Re + Im*i" (after separating the Re and Im parts), by using
    "String:Format into String" with 2 numeric inputs and the format string
    "%f+%fi".
    Reading the data back into Labview then would require splitting the
    string into the 2 pieces by using "Stringcan from String" with 2
    numeric outputs (smae precision as original numbers specified by the 2
    Default Value inputs) and the same format string "%f+%fi", and then using
    the above-mentioned "Numeric: Re/Im to Complex" function. It worked for
    me, so if you can't follow what I am describing, send me an email and I
    can email you what I did (LV 5.1.1).
    Paul
    Biz wrote:
    > Having trouble converting array to spreadsheet string, storing the
    > file and coverting back to array with complex numbers
    >
    > I am working with a network analyzer. I have arrays made of 5 columns
    > the first consisting of an integer and the next four consisting of
    > complex numbers. I am converting the array into a spreadsheet string
    > and then saving the file using the write characters to a file VI. That
    > seems to work well as when I open the file in Excel all the data is
    > there. However when I try to reverse the process, open file and
    > convert back to array, I loose some of the data. Specifically the
    > imaginary parts of my complex numbers are all going to zero. I have
    > narrowed down the problem to be in the conversion from spreadsheet
    > string to array and vice versa. I think the problem may be with the
    > 'format' input to the VI. I do not have an adequate resource for this
    > so I am not sure what to put in to accomplish my task. Any takers?
    Research Assistant
    School of Physiotherapy, Curtin University of Technology
    Selby Street, Shenton Park, Western Australia, Australia. 6008
    email: [email protected]
    Tel. +61 8 9266 4657 Fax. +61 8 9266 3699
    "Everyone who calls on the name of the Lord will be saved." Romans 10:12
    "For all have sinned and fall short of the glory of God, and are
    justified freely by his grace through the redemption that came by Christ
    Jesus." Romans 3:23-4

  • Having trouble converting a string to a double

    Im having problems converting a string to a double in my jsp pages, i have pasted part of the code that is causing the problem. Just a note, i have imported the java.lang.* classes also
    while ( rs.next() )
    String price = rs.getString("price");
    sPrice = double.parseDouble(price);
    out.println("<TD>$" + decimalFormat.format(sPrice) + " </TD>");
    An error occurred at line: 140 in the jsp file: /cs399/AddToShoppingCart.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\jakarta-tomcat-4.1.29\work\Standalone\localhost\_\cs399\AddToShoppingCart_jsp.java:277: class expected
              sPrice = double.parseDouble("price");
    ^

    double is a primitive. You want java.lang.Double, with a capital "D":
    sPrice = Double.parseDouble(price);MOD

  • Access 2007 ADP to SQL Server 2012 with extended protection

    Hello,
    I have a Access 2007 ADP client connecting to an sql server 2012. This works fine with standard security configuration, but when I activate extended protection on the SQL server, the Access client cannot connect to the server. I am using integrated security
    with a domain user and get the error message
    "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication."
    In sql server logfile I find:
    "SSPI handshake failed with error code 0x80090346, state 46 while establishing a connection with integrated security; the connection has been closed. Reason: The Channel Bindings from this client are missing or do not match the established Transport
    Layer Security (TLS) Channel".
    Is there any "easy" solution other than developing a new client based on an up to date Office version or Dot.Net?
    Regards,
      charles-f

    Well, I have no problem connecting to the sql server from my pc using ssms with my domain account. I have also sucessfully create a odbc connection using the "SQL Server Native Client 11.0" driver and my domain account. My account is in a trusted
    domain, so this seems not to be the problem. 
    To me it rather looks like if Access is using an old driver which does not support the tls encryption required by the extended protection settings.
    regards, charles-f 

  • Converting a SSAS 2008 R2 database into a SSAS 2012 Tabular database

    Hi,
    I'd like to know if it is possible to convert or migrate in whatever manner a SSAS 2008 R2 database (multidimensional) into a SSAS 2012 Tabular database.
    Many thanks

    Unfortunately there is no way to convert or migrate a multidimensional cube to a tabular model.
    This MSDN article says ...
    Because tabular is the newer solution, you might think that migrating an existing multidimensional solution to a tabular format is
    the correct course of action, but this is usually not the case. Tabular does not supersede multidimensional, and the two formats are not interchangeable.
    If you need to migrate a cube to tabular (maybe for performance reasons), unfortunately you need to build it from scratch.  I believe the reason for this is that there are concepts that do not translate across the technologies.  There are no good
    3rd party tools that I'm aware of that even attempt to do this.
    Christian Wade
    http://christianwade.wordpress.com/
    Please mark correct responses as answers!

  • Having trouble converting a pdf document to word .docx

    http://answers.acrobatusers.com/ViewQuestion.aspx?tc=1811155930102109201488816&q=211509&ac tion=watchQuestion&questionId=211509&vote=1 
    I bought Adobe ExportPDF, Annual membership to convert PDF documents into .docx but can't seem to do this now.
    My pdf is stuck on 'Retrieving current session status' when I try to convert it to .docx. Why?

    Hi Florence,
    I have accessed a document however the conversion has generated this letter head... It should read JAPSER CORNER
    and this signature...
    So... when I used to click on the Tools button, it was very simple to convert the document. It's not so simple now - still not working.
    Can you please advise me as to how to regain full operation of this Tool and Adobe product.
    Can you please check that my subscription is up to date.

  • Having troubles converting RGB to CMYK

    @Hi guys
    I having massive issues with converting my business logo form RGB to CMYK. I need to place this logo on my business card ready for printing. I created the logo in RGB format to start of with, but it keeps coming out darker and abit grayscaled
    once the conversation is set. Can anyone help me out with this issue, and if so, can you also provide the steps in how to resolve this issue for future references. Im using Adobe Photoshop CS5 for this execise. I can also provide the actual image attached below as the second image,.

    These bright pink and purple colours are obviously way out of gamut so they convert badly to CMYK. Exactly how they convert depends on what colour profile you are using
    It will probably be best to either rework the design using mixtures of cyan and magenta only or else use mixtures of Pantone colours.
    The Pantone solution will only work for offset printing but is no use for a home printer.
    Read up on colour management like Mylenium says and learn to think in terms of inks rather than screen colours.

  • Having trouble converting video to dvd

    Hi there. I am trying to convert an 8mm tape to dvd. I imported using FCP, i made my necessary edits and then converted them to a quicktime file and imported the clips to iDVD and burned my disc. the problem I am having is that when I playback the dvd anytime there is motion it gets very pixelated and looks like garbage. I am sure there is a setting that I am missing, or not converting it properly. I really need some help on this.
    here is the process by which I am exporting the edited piece to burn to DVD,
    Export: Using Quicktime conversion. My settings are: Compression H.264, Quality: best, Key Frame Rate:24, Encoding:multipass, and Dimensions 720x480(4:3)
    I am just looking for the most convenient way to transfer and edit these tapes to dvd without the glaring pixelation problems.
    thanks
    Jason

    Jason
    here is the process by which I am exporting the edited piece to burn to DVD,
    Export: Using Quicktime conversion. My settings are: Compression H.264, Quality: best, Key Frame Rate:24, Encoding:multipass, and Dimensions 720x480(4:3)
    First, you must feed iDVD with an uncompressed copy of your movie, what means, same settings that your timeline. Select Export > Quicktime Movie (not conversion!) > Same settings. Then use that file as soure in iDVD. iDVD will encode this file to MPEG2 video.
    Second, I suggest you learn to use Compressor and DVDSP. iDVD will not give you too much encoding control. With Compressor you can set the exact encoding parameters you need, including AC3 (Dolby) audio. iDVD uses AIFF audio that can cause skips when playting in stand alone players because the high bitrate.
    Hope that helps !
      Alberto

  • Having trouble converting quick time to mpeg4

    i have a bunch of music videos that are in quick time format that i would like to put on my ipod, but when i try and "convert selection for ipod" it gives me a message that i cant be converted because the file does not allow converting or saving... is there some way i can work around this or am i just not going to get to watch my videos on my ipod?

    On my ibook, I just add the quicktime video to itunes, then select it and go to the edit toolbar on top (I think it is the edit toolbar, check them all) and click "convert selection for iPod". Whenever i have done this for a quicktime video the audio and video both work great and it goes onto my ipod just fine.
    Hope this Helps!

  • I'm having trouble converting a Word Form to a PDF form because the table cells are importing incorrectly. How can I fix it?

    I am converting a form from Word to PDF. The form includes several tables and the tables are converting with weird lines where the corners meet. I've tried everything. I've even retyped a portion of the form and tried importing it but it still had the weird lines. I'd rather not recreate the form in PDF because it's not short and I already have a perfectly good form to import. Any suggestions?

    What version of Word? What version of Acrobat? How exactly are you converting the file?

  • I'm having trouble converting file to excel...i just purchased this yesterday

    I keep getting the message
    'FILE FAILED TO BE CONVERTED USING ADOBE EXPORTPDF ONLINE
    PLEASE HELP.

    I have just purchased Adobe PKF Pack, I am trying to convert from PDF TO WORD.  The reason why is that I cannot adjust the margin stops and it won't change the user file name when I go to save. example I have file mamed Herman and I want to save it under Betty it will not save.
    I have paid $ 1.99 per month for a year and if I cannot convert then I don't need ADOBE PDF PACK

  • I have Elements 12 and a Nikon D3300 Camera I am having trouble converting Nef files to DNG can anybody please help?  Geoff

    I didn't realise there was such a wide range of RAW files

    The D3300 requires DNG converter 8.4 or newer. That version of the DNG converter requires Windows 7 or newer. Lightroom isn't an option because it requires Windows 7 or newer. It looks like it's time for new computer.

Maybe you are looking for

  • LogMiner puzzle - CLOB datatype

    Hello, everybody! Sorry for the cross-post here and in "Database\SQL and PL/SQL" forum, but the problem I am trying to dig is somewhere between those two areas. I need a bit of an advice whether the following behavior is wrong an requires SR to be in

  • Viewing XML in forms 10g

    How to view XML in forms 10g? I have a message in XML/HL7 format and display information a end user. Thanks you all. Dario

  • Creation of New IN/OUT queues in B2b

    Hi, Is it possible to create and use Queues in B2B rather than using the default IP_IN_QUEUE and IP_OUT_QUEUE? Thanks, Phani

  • Difference Between Book on sap press and Advice on which book I should take ?

    Hello, Could someone explain me the difference between those two Sap Press. SAP CRM Web Client Customizing and Development http://www.sap-press.com/products/SAP-CRM-Web-Client-Customizing-and-Development.html SAP Web Client: A Comprehensive Guide for

  • Mail Subject Line Automatically Selects All Text When Typing

    In Mail I'm typing along in a subject line and randomly the all of text I've entered becomes selected. Then my next keystroke deletes the first entered text. Very frustrating, and I can't figure out why this happens. Maybe OSX's spell checker? How do