Help! It drives me crazy. Report CASE (missing operator) statement syntax error

Hello

Can anyone help with this SQL statement please. It uses a CASE statement but again I get a syntax error (missing operator) error message. The SQL statement runs without the CASE statement, so everything else is fine - it's just when I put the CASE back statement in.

Here is the SQL statement:-

SELECT transactions.ourRef, transactions.transDate, CASE WHEN transactions.transTypeID = 2 THEN transactionDetails.goodsVatable *-1 ELSE transactionDetails.goodsVatable END, transactionDetails.goodsNonVat, transactionDetails.VAT, transactionDetails.grandTotal, clients.clientCode, transTypes.transTypeDesc
Operations, customers, transactionDetails, transTypes
WHERE transactions.transID = transactionDetails.transID
AND transactions.clientID = clients.clientID
AND transactions.transTypeID = transTypes.transTypeID

TransID = 2 means that it is a credit not instead of a Bill, that's why I want the goods vatable returned as a negative number.

Thanks in advance.

Wez

Quote:
.. .the customer wish for me to use a MS Access db

Too bad that you said that in a first time. I think you can consider using IIF() with access.

Syntax: IIf (expr, truepart, falsepart)

SELECT transactions.ourRef,
transactions.transDate,
IIf (transactions.transTypeID = 2, transactionDetails.goodsVatable *-1, transactionDetails.goodsVatable).
transactionDetails.goodsNonVat,
transactionDetails.VAT,
transactionDetails.grandTotal,
clients.clientCode,
transTypes.transTypeDesc
Operations, customers, transactionDetails, transTypes
WHERE transactions.transID = transactionDetails.transID
AND transactions.clientID = clients.clientID
AND transactions.transTypeID = transTypes.transTypeID

Phil

Tags: ColdFusion

Similar Questions

  • Stmt case answers column fx syntax error

    Hello

    I want to update the 'Project name' column that is of type VARCHAR to "Undefined" If the "Project_date" column has a value of January 1, 1900 12:00 "." I use the stmt case following answers column Fx of 'Project name' but do syntax error.

    BOX WHEN "hand-made". "" Project_date "= January 1, 1900 12:00 ' THEN 'Undefined' ELSEWHERE 'hand made '. "' Project name ' END

    Thanks for your time and your help.

    Hi Ssk,

    It should work. Please make sure once again that the underside of things in your query:

    (1) 1st January 1900 12:00 - value exists in the column
    (2) and remove all spaces between the column name and values.

    Without spaces:

    BOX WHEN "hand-made". "Project_date" = January 1, 1900 12:00 ' THEN 'Undefined' ELSEWHERE 'hand made' "." " The project name"END;

    I would like to know if that works for you or not.

    Thank you
    -Laurence.

  • Help me! All my text in PDF files are Magenta and it drives me crazy!

    My printer ran out of black ink, so I somehow a way to change the black to 100% magenta text in order to print. Apparently, Adobe has retained this setting, and now every time I open a PDF file, all text is magenta. I do not remember for the life of me how I changed it in the first place, and I can't figure out how to restore it. I went in ' Advanced > Print Production > convert colors "and tried many combinations to try to recover it, but it did not work. I have a feeling that's not what I did in first place (also given that printing does not always work after the change), so I think I did something in all options 'View '. Someone knows how to fix this? It drives me crazy. Thank you!

    Program: Adobe Acrobat Pro version 9.0.0

    Computer: MacBook Pro

    Software: OS X Yosemite 10.10.3

    Try: Acrobat > Preferences > accessibility > replace the colors in the Document

  • Help me! I changed the text to 100% Magenta and it drives me crazy!

    My printer ran out of black ink, so I somehow a way to change the black to 100% magenta text in order to print. Apparently, Adobe has retained this setting, and now every time I open a PDF file, all text is magenta. I do not remember for the life of me how I changed it in the first place, and I can't figure out how to restore it. I went in ' Advanced > Print Production > convert colors "and tried many combinations to try to recover it, but it did not work. I have a feeling that's not what I did in first place (also given that printing does not always work after the change), so I think I did something in all options 'View '. Someone knows how to fix this? It drives me crazy. Thank you!

    Program: Adobe Acrobat Pro version 9.0.0

    Computer: MacBook Pro

    Software: OS X Yosemite 10.10.3

    Hello

    Please, try the following steps. I'm sure it would work.

    Launch Acrobat > go to Preferences > select accessibility > select Replace Document colors.

    Let us know how it goes.

    Concerning

    Sukrit diallo

  • I have a small black square box that suddenly appeared on my iPad screen and I can't get rid of it. It is said to perform a zoom, zoom full screen, etc. When you click on it. I have to remove my screen; It drives me crazy.

    I have a small black square that has all of a sudden shiown on my iPad screen and I can't get rid of it. When you click on it, it is said, perform a zoom, zoom full screen, etc. I need because it drives me crazy.

    Help!

    You have one of the accessibility features enabled. Go to settings > General > accessibility and Zoom 'off' (the icon you see is the 'Show' controller on screen Zoom settings) - and check what accessibility shortcuts (a triple-click of the home button) is defined in the lower part of the screen for accessibility

  • Equium L20: Lost CD/DVD drive - driver may be corrupted or missing (Code 39)

    I just lost the driver POINEER DVD - RW DVR-K16S. For some reason, it's a troublesome TI since im doing a computer course, I've been online and can not find the driver at all, I tried also to update via Windows and nothing. "Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. (Code 39) »

    This is the message I receive via the Device Manager. Any help or pointers as to get this driver greatly desired. I can load the driver myself i just have to find it. The driver disappeared after apron anything malicious on a CD.

    Thank you very much

    Check this box:
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=13843&MessageID=50483

    It should work! ;)

  • Satellite P30: The driver may be corrupted or missing (code39)

    Hi, I tried to play a game this morning to discover that I have apparently not a DVD player!
    I went to the device manager that has a yellow exclamation mark on the disk.
    I clicked on properties, it says: "Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. (code39) »
    I tried to update the driver who couldn't, I also tried to roll back only the pilot but could not.
    I tried to uninstall the drive from the Manager of devices and reinstalling that also failed, I also tried to download the driver from the Web from Toshiba site, but it did not help.

    It started this morning, watched a DVD last night, it was fine, I don't really know what happened!
    Anyone know what could be the problem?

    Reasons for this error include a driver that is not present; a binary file is damaged; a file I/O problem or a driver that makes reference to an entry point in another binary file that could not be loaded.

    Uninstall the form driver in the Device Manager and after reboot click on search the hardware changes to reinstall or upgrade the driver.
    On the tab General properties of the device, click Troubleshoot to start the Troubleshooting Wizard.

    Also try this:

    There are 2 reg keys that can screw the device... Remove them both and restart...

    The keys are:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro {4D36E965-E325-11CE-BFC1-08002BE10318}-«l\Class\ Upperfilters"and"Lowerfilters ".

  • Device Manager show that this driver may be corrupted or missing (error code: 39) on CD/DVD devices

    Device Manager has a yellow ball with an asterisk on the CD & DVD devices.  My computer does not display a device.  The Device Manager has a message that the driver may be corrupted or missing (Code 39).  It happened after uninstalling Norton and McAfee installation.  I uninstalled McAfee and tried to install the drivers.  I uninstalled and reinstalled the device.  Still no CD or DVD displayed in my count.  Everybody recognizes the problem?

    Original title: CD & DVD devices do not work

    Try following the steps under "Windows XP" in the article following the MS KB:

    http://support.Microsoft.com/kb/982116

    These measures, to remove the UpperFilters and LowerFilters, values if they exist, in the registry key named can help.

    Create a System Restore Point beforehand and restart the computer later.

  • Windows XP cannot load the device driver for the CD burner. The driver may be corrupted or missing. (code39)

    I have a HP Pavilion running on XP.

    Device Manager displays the following material: A: HP CD Writer CD16b

    B: pioneer DVD - RomDVD - 116.

    Both have the dreaded yellow symbol showing that they are not working (they do not show in Windows Explorer)

    By clicking on the two points of product

    "Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. (code39).

    I created the 'properties' of each machine that pilots should be:

    For a. imapi.sys, redbook.sys c:\windows\system32\storprop.dll, pfc.sys and similarly for B machine.

    I copied imapi.sys, redbook.sys, and storprop.sys from another XP computer (which works well), deleted these drivers and pasted in the replacements.

    Does not cure the problem.

    Now the pilot 'pfc.sys' cannot find anywhere else. Click on the driver generates (v 2.1.0.165 Inc. - Padus ASPI Shell)

    I'm out of my depth now. No idea what is ASPi Shell.

    Help, please

    The problem is most likely the pfc.sys.

    What I would say, is to follow the steps under "Windows XP" in the MS KB article:

    http://support.Microsoft.com/kb/982116

    These measures, to remove the UpperFilters and LowerFilters, values if they exist, in the registry key named can help.

    Create a System Restore Point beforehand and restart the computer later.

    Following steps should remove pfc.sys which may have been left to the wire after that uninstall of software associated with the readers.

    Here is some info on the pfc.sys:

    http://www.Neuber.com/TaskManager/process/PFC.sys.html

  • Audio loss. UAA Bus Driver reads Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. (Code 39). All the patches?

    Audio loss.  Device Manager indicates Microsoft UAA Bus Driver as: "Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. (Code 39) ».  Tried to update driver and restore without success.  Tried the program of "Fix - It", which has identified an error with the sound system, but said that he could not fix it.  Restored to an earlier date but still what system did not go.  Tried to uninstall and reinstall the driver.  Uninstall was successful but reinstall it read that the hdaubus file does not exist.  I'm a computer dunce.  Any help out there?

    Hi BarbaraWolfe,
     

    There are many causes of Code 39 errors:

    • A required device driver is missing.
    • A required binary file is corrupted.
    • There is a problem with the file I/O process.
    • A driver that refers to an entry point in another binary file cannot load.
    Re-install the driver by downloading it from the link given:
     
    Additional reference on:
    Check if that helps.
  • Add/Remove components error and DVD driver error: Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. (Code 39)

    Original title: Add/Remove components error and DVD driver error

    Yesterday, I removed several components of windows to attempt to clean my cpu. After the reboot, I noticed that my DVD drive disappeared. I tried to update the driver but told me I have the most updated version, I uninstalled and reinstalled the drive, but I still get the same error. Under Driver Details, it shows that I have a lot of drivers for my Phillips DVD player. However, the status of the device is the following: Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. (Code 39) Click Troubleshoot to start the troubleshooter for this device. I've done the troubleshooting, and the two options has not fixed the problem.

    Then I tried to add windows components that I removed, thinking maybe that was the problem. However, when I try to add them, I get an error message that says: 'Setup cannot copy the file zClientm.ex_' it shows the location of this file as being in windows/i386, and of course, the file is located in this folder. So when I go to browse to locate the file, I find and click on it to open it, but I keep getting the same error message that the file is not found and Setup cannot continue.

    I realize that this problem seems very rare and weird, but any help at all would be appreciated. Thank you.

    Hello
     
     
    Code 39: Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. (Code 39)
    Explanation of error codes generated by the Device Manager in Windows XP Professional http://support.Microsoft.com/kb/310123
     
     
    Method 1.
    Microsoft Automated Troubleshooting Services scans your computer and detects that the root causes of common problems, then automatically solves the problems that he finds and offers additional resources if the problem is not resolved. Click run now in the article below.
    Your CD or DVD drive cannot read or write media
    http://support.Microsoft.com/GP/cd_dvd_drive_problems
     
     
    Method 2.
    Also, try the methods listed in the section below and check.
    Your CD or DVD drive is missing or is not recognized by Windows or other programs
    http://support.Microsoft.com/kb/982116
     
     
    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Windows cannot load the device driver for this hardware (HL-DT-ST DVDRAM GH40F SCSI CdRom Device) because the driver may be corrupted or missing. (Code 39)

    Original title: the answer useful?

    Help, please! Windows cannot load the device driver for this hardware (HL-DT-ST DVDRAM GH40F SCSI CdRom Device) because the driver may be corrupted or missing. (Code 39)

    Hello

    Code 39 means that the driver is corrupted or missing.

    Please make all below even if you have done some before as it is often the set of operations which solves
    the question.

    Try this - Panel - Device Manager - CD/DVD - double-click on the device - driver tab - click
    Update the drivers (this will probably do nothing) - then RIGHT click the drive - UNINSTALL - REBOOT
    This will refresh the default driver stack. Even if the reader does not appear to continue below.

    Then, work your way through these - don't forget the drive might be bad, could be a loose cable or
    slight corrosion on the contacts (usually for a laptop) and other issues.

    Your CD or DVD drive is missing or is not recognized by Windows or other programs
    http://support.microsoft.com/kb/314060 - a Mr Fixit

    Try this fix manually if the Fixit 314060 does not work
    http://www.pchell.com/hardware/cd_drive_error_code_39.shtml

    Your CD or DVD drive is missing or is not recognized by Windows or other programs-
    a Mr Fixit
    http://support.Microsoft.com/kb/982116

    The CD drive or the DVD drive does not work as expected on a computer that you upgraded to Windows Vista
    http://support.Microsoft.com/kb/929461

    When you insert a CD or a DVD, Windows Vista may not recognize the disc
    http://support.Microsoft.com/kb/939052

    Your CD or DVD drive cannot read or write media - A Mr Fixit
    http://support.Microsoft.com/GP/cd_dvd_drive_problems

    CD/DVD drive does not appear in Windows Vista, or you receive this error during the installation of Windows Vista after booting from the DVD (AHCI)
    http://support.Microsoft.com/kb/952951
    Drive CD - R or CD - RW Drive is not recognized as a recordable device
    http://support.Microsoft.com/kb/316529/

    Hardware devices not detected or not working - A Mr Fixit
    http://support.Microsoft.com/GP/hardware_device_problems

    Another possibility is that the cables are loose. Remove ALL power, then make sure that the cables in both
    ends. Remove and replace, do not just tight. For laptops, you can often clean power and
    contacts data with a pencil eraser.

    --------------------------------------------------------------

    Also check with your system manufacturer to see if there are any updated drivers for your DVD. Or even if it
    are you can reinstall the 'old'. Many use Windows default drivers however some special aura
    ones. Also check the website of the manufacturer of the car.

    Look at the sites of the manufacturer for drivers - and the manufacturer of the device manually.
    http://pcsupport.about.com/od/driverssupport/HT/driverdlmfgr.htm

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • DVD player does not appear error - the driver may be corrupted or missing. Code 39, fix the driver installation fails, virtual drives don't work - same results if the material under tension

    Original title: drive does not appear, difficulty he pilot installation fails, virtual drives don't work - same results if the material under tension

    A few weeks ago, as my two DVD players (the two Samsung Lightscribe SH-S223Q of) disappeared after a repair installed, I did for the other problems (not sure if it was directly after installation because I don't notice it right away, but it was no doubt). In Device Manager, it gives the message:

    "Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. (Code 39) »

    I tried the Microsoft Fix It tool (Mats_Run.dvd.exe) that detects the problem and says "Install device driver" in a popup, but then he says "software device driver failed to installed. At the end it says under the issue, the "CD/DVD drive is not detected" and the status of Fix 'not set '. Note that, when I boot from another hard drive (with Vista 64 on it installed from the same DVD, just a new installation) disks appear very well. Also I can boot from the drive as well.

    I can't do a repair installation, since it must initiate Windows, and I can't load the disc. I tried to update my BIOS but that has no effect.

    Recently I actually moved this hard drive to another one, with another brand of hard drive and all the rest. Just like before, if I boot from another hard drive (this one with Windows 7), the drive unit-a Optiarc AD-7230 s - looks and works, and I can also boot from the drive at startup. But since the drive hard as I want to use, the drive does not appear. Fix it, etc. Device Manager gives the same messages as before.

    I tried virtual drives - Daemon Tools Lite and Virtual Clonedrive. When I try to add virtual devices to help, nothing happens. The new drive will be displayed in the Manager of devices, but with the same error Code 39 as the real drive.

    What are my options at this point? How can I get the drive to appear or to fix my copy of Windows?

    I could solve this problem. I started in Ubuntu and deleted the existing cdrom.sys, cdrom.inf etc. files (as in Windows, they were protected and I couldn't delete them), then I copied the files from another installation of Vista I had on another hard drive. After having done that, I updated the drivers in device, disabled/enabled readers and readers management that presented themselves.

  • Microsoft Bluetooth Notebook Mouse 5000 installation error: "problem installing the driver for the device software - file to install the driver for this device is missing a necessary entry.» Maybe it's because the file INF was written for windows 95 or la

    Original title: Microsoft Bluetooth Notebook Mouse 5000 install problem

    I have a LG S1 Pro Express dual computer with vista sp2. My Bluetooth Notebook mouse 5000 can be coupled to my computer, but after pairing, it will say "Device Bluetooth HID - ready to use" and "unidentified - device failed. It then opens a window saying "problem of installing the software driver for the device - driver for this device is missing a necessary entry.» Maybe it's because the file INF was written for windows 95 or later. »

    I checked some things here and read about intellipoint 7.x and installed but it still does not work. This used to work before mouse

    Hello
     
     
    The drivers that you try to install seems to be corrupted. Let us fisrt remove all traces of the software driver for this device in the Device Manager and then install the drivers from the manufacturer's Web site.
     
    Step 1.
    You can uninstall the audio drivers completely from the Device Manager and re-install from the manufacturer's Web site.
    I would also recommend to check if there are Windows updates for this device.
     
    Step 2.
    Here is the link to download the latest drivers.
    http://www.Microsoft.com/hardware/download/download.aspx?category=MK
     
    Select the type of product like "Mouse" and select the product as "Notebook Optical Mouse" and your version of operating system and the language of the operating system.
     
    This page will direct you to a link to download the IntelliPoint software, which is the software of the mouse.
     
    For more information see the links below.
     
    I hope this helps.
     

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • ' driver may be corrupted or missing (code39).

    New computer, the CD ROM won't work, troubleshoot-performed and received this message "driver may be corrupted or missing (code39). device checked and see two 2 drivers, one for; DRIVER\CDROMSYS and the other for;  DRIVER\PXHIPA64SYS.

    Hello

    Code 39 means that the driver is corrupted or missing.

    Please make all underneath the same if you've done it before as it's often the total of the process which
    solves the problem.

    Try this - Panel - Device Manager - CD/DVD - double click on the device - driver tab.
    Click on update drivers (this will probably do nothing) - RIGHT click ON the drive - uninstall.
    RESTART this will refresh the default driver stack. Even if the reader does not appear to continue
    below.

    Then, work your way through these - don't forget the drive might be bad, could be a loose cable
    or slight corrosion on the contacts (usually for a laptop) and other issues.

    Your CD or DVD drive is missing or is not recognized by Windows or other programs
    http://support.microsoft.com/kb/314060 - a Mr Fixit

    Try this fix manually if the Fixit 314060 does not work
    http://www.pchell.com/hardware/cd_drive_error_code_39.shtml

    The CD drive or the DVD drive does not work as expected on a computer that you upgraded to
    Windows Vista
    http://support.Microsoft.com/kb/929461

    When you insert a CD or a DVD, Windows Vista may not recognize the disc
    http://support.Microsoft.com/kb/939052

    Your CD or DVD drive cannot read or write media - A Mr Fixit
    http://support.Microsoft.com/GP/cd_dvd_drive_problems

    CD/DVD drive does not appear in Windows Vista, or you receive this error during Windows Vista
    Setup after booting from the DVD (AHCI)
    http://support.Microsoft.com/kb/952951
    Drive CD - R or CD - RW Drive is not recognized as a recordable device
    http://support.Microsoft.com/kb/316529/

    Hardware devices not detected or not working - A Mr Fixit
    http://support.Microsoft.com/GP/hardware_device_problems

    Another possibility is that the cables are loose. Remove ALL power, then make sure that the cables in both
    ends. Remove and replace, do not just tight. For laptops, you can often clean power and
    contacts data with a pencil eraser.

    --------------------------------------------------------------

    Also check with your system manufacturer to see if there are any updated drivers for your DVD. Or even
    If there are 'old', you can reinstall. Many use Windows default drivers, but a few will be
    have more special. Also check the website of the manufacturer of the car.

    Look at the sites of the manufacturer for drivers - and the manufacturer of the device manually.
    http://pcsupport.about.com/od/driverssupport/HT/driverdlmfgr.htm

    Hope these helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

Maybe you are looking for