How do I add 7 days to a date and compare it to the current date in a cfquery?

I have classes that are no longer active once after the date of the class. However, the class should be displayed for seven days more in the backend. I tried to use the script below to get there, but I get an error "Variable DATE is not defined." I'm going in the right direction or is there a better way to do this?

< name cfquery = "getClasses" datasource = "#application.dsn #" >

Select *.

(break the classReg INNER JOIN classReg.classID = classes.classID) INNER JOIN instructors ON classreg.instID = instructors.instID

<!-adding seven days to the date of the class (date) by comparing the current date->

where #DateFormat (DateAdd (would be ', 7, date), 'yyyy-mm-dd') # > #DateFormat (now (), 'yyyy-mm-dd') #.

< / cfquery >

where #DateFormat (DateAdd (would be ', 7, date), 'yyyy-mm-dd') # > #DateFormat (now (), 'yyyy-mm-dd') #.

As Coldfusion said you, quite rightly so, he knows no variable called "date". You're in a request and, apparently, 'date' is a column name. So use the SQL functions instead of Coldfusion functions.

In MySQL, the appropriate where clause is:

WHERE DATE_ADD (date, INTERVAL of 7 DAYS) > CURDATE)

In SQL Server, the appropriate where clause is:

WHERE DATEADD(day,7,date) > GETDATE()

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

Afterthought: I would rename the column 'date', as it is a reserved word in some database management systems

Tags: ColdFusion

Similar Questions

  • How I ouptut a digital waveform, it has collated and compare it to the original with a usb-6211 box?

    I want a digital waveform to a circuit of output, read the return signal and compare the original to the read signal. I use a usb-6211 housing is it possible and if so, how?

    Use a comparator "equals sign", mark the post as a solution if you have the makings of what you wanted.

  • How do you add 1 day to a date in the BI answers

    Hello

    I tried to just put (column date + 1) in the formula in the column, but he has not been seen
    all. In SQL, you can just put SYSDATE + 1. Is it possible to convert the
    When a certain number, I can do math with her?

    Thanks a lot for all ideas.

    -Julian

    In OBIEE functions check 'TimestampAdd.
    Syntax TIMESTAMPADD (interval, expr, timestamp)
    Description adds a specified number of intervals to a specified timestamp and returns a unique timestamp.

  • How to add / remove UOMs of NET, TARE and GROSS weight on the business page?

    How to add / remove UOMs of NET, TARE and GROSS weight on the business page?

    I've also attached the screenshot of what I want to add / remove.

    I am currently using v6111.11

    Please do the needful.

    Thank you

    Nefertari

    You can set up your display of the user interface by using the user interface extensibility. You can learn more about the extensibility of the user interface in the Pack of extensibility.

    Here is an example of javascript that you can use to filter the fields weight gross and net.  You can add a var and tare weight.  The script is the targeting of fields based on their identification. You can find their identity papers using the tools of the developer of the browser. For example, the tare weight UOM dropdown ID is "ctl01_CtlPackagingAttributeCU1_ctlCollapsibleContentContainer_ctl00_ddTareWeight" you can find all the pkids GLU in the UOM db table.

    Make sure you have no business page in the system with all UOMs filter you selected.  If so, these selections will be lost.  You can further customize this script to include the selected UOMs if you prefer.

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

    function filterUOMs() {
      var NetWeightAllowedUOMs = ['',
    '2125C9F3D300-AA30-446E-8332-F177CD142950','2125B86219F3-9C78-4a6e-ABD2-506D34BCE275','2125AAC32296-A303-4d7f-B4EF-BA2003573D3E','21257FBD57ED-79FC-44be-8F0D-82E4045ACDD1','21252CEBFF48-9690-408c-AA79-6B7CAAA35D0A','21250E2887F6-6A3E-4862-A7FD-BDCDF75A404D','2125042958D3-E33A-4537-B029-098D065AF1A3','21256C0CC1E3-378A-43bd-B6E2-F7A0A23B42DA','2125586D8B32-95B9-4ebe-BDC1-285420735436','21255703D0DF-B497-4400-A716-38D674693954','21251C1A1522-134D-45a4-BC6B-6E3DEA51F740','212514d3bd78-29b3-495a-a852-3028f0a60b34'];
    
    var GrossWeightAllowedUOMs = ['',
    '212514d3bd78-29b3-495a-a852-3028f0a60b34','21251C1A1522-134D-45a4-BC6B-6E3DEA51F740','2125586D8B32-95B9-4ebe-BDC1-285420735436'];
    
      var majorNetWeight = $("select[id='ctl01_CtlPackagingAttributeCU1_ctlCollapsibleContentContainer_ctl00_ddContainerNetWeightMajor']"); // find Container Net weight major UOM drop down
      if (majorNetWeight.length > 0) { // if drop down exists, compare each option and remove those not in allowed UOMs
      majorNetWeight.find('option').each(function () {
      if ($.inArray(this.value, NetWeightAllowedUOMs) === -1)
      {
      $(this).remove();
      };
      });
      }
    
      var minorNetWeight = $("select[id='ctl01_CtlPackagingAttributeCU1_ctlCollapsibleContentContainer_ctl00_ddContainerNetWeightMinor']"); // find Container Net weight minor UOM drop down
      if (minorNetWeight.length > 0) {  // if drop down exists, compare each option and remove those not in allowed UOMs
      minorNetWeight.find('option').each(function () {
      if ($.inArray(this.value, NetWeightAllowedUOMs) === -1)
      {
      $(this).remove();
      };
      });
      }
    
      var GrossWeight = $("select[id='ctl01_CtlPackagingAttributeCU1_ctlCollapsibleContentContainer_ctl00_ddCUGrossWeightUOM']"); // find Container Net weight minor UOM drop down
      if (GrossWeight.length > 0) {  // if drop down exists, compare each option and remove those not in allowed UOMs
      GrossWeight.find('option').each(function () {
      if ($.inArray(this.value, GrossWeightAllowedUOMs) === -1)
      {
      $(this).remove();
      };
      });
      }
    };
    
    $(document).ready(filterUOMs);  // execute filtering when page is loaded
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(filterUOMs); // execute filtering when a section is refreshed, like clicking gross weight calc
    
  • How can I make my default email address Qwest and get rid of the Windows Mail in Internet Explorer.

    I tried to change my default email address in IE from my old Cableone address to my new address Qwest.  I followed the steps on the Web site of Qwest, but now my emails are transferred to Windows Mail and remove from Qwest.

    How can I make my default email address Qwest and get rid of the Windows Mail?
    If you want to use Webmail and not Windows Mail, an e-mail client, just remove the Windows Mail account in tools | Accounts.
  • I can't find a newer version of adobe flash player for ubuntu 14.04, I tried to use the apt version but it wouldn't work and I don't know how to use the tar.gz files and install, I think the current version to .deb

    I can't find a newer version of adobe flash player for ubuntu 14.04, I tried to use the apt version but it wouldn't work and I don't know how to use the tar.gz files and install, I think the current version to .deb

    Hi LF12,.

    The latest version of Flash Player for Linux is 11.2.202.400.  The current versions of Flash Player are displayed here http://www.adobe.com/software/flash/about/. The versions on the page are updated with each new version.

    --

    Maria

  • How to upgrade a resettled Acrobat 9 Pro 9.0.0 version to the current version?

    How to upgrade a resettled Acrobat 9 Pro 9.0.0 version to the current version?

    Under the help in the top tool bar option should have an option for updates...

  • RE; How can I add a cd rom disk driver to a top of the tower that has no one.and do I have to format disks before I can put them in the driver?

    I just bought a laptop drive for my laptop which do not have. What is the right device? If this is not the case, what camera to buy so I can record information from my computer to a disc, when I don't have a disk driver on my computer. also, I have to do something to the drive first in order to make it work?

    Here are the facts:

    I have an acer aspire one that isn't a disk driver (which would allow me to save my separately from the document, photos and videos).

    I'd like take what I have on my computer and store it on a disk. I thought I would buy a cd rom drive, then I could do it.

    but now that I have this cdrom drive. I'm going to download the document and it keeps saying disk (?), I put a disc Virgin installation cd in and it does not recognize. Do I have to format the drive? and if yes, how do I do that?

    I put in a cd (musci) and it plays very well.

    It records on my computer as drive D.

    IM missing some knowledge. someone can help me.

    I buy the wrong thing?

    What to buy to add to my laptop, so I can transfer my videos, photos and the paper out of my computer and on a disc?

    Thank you

    E-mail address is removed from the privacy *.

    I always use Nero or Roxio software, but Windows XP it has a function limited to do so.  First of all, if you must make sure that the drive you purchased is able to WRITE on the discs.  The vast majority are, but you should check that first.  Normally Windows will find the right driver for the latter and load it, but you can check the Device Manager to see.  XP if the memories are good, you click on Start-> support-> Device Manager.  Locate the entry of CD/DVD.  If there is none? or! next to him, you have the right driver.  Also, if your device came with a driver, it is another indication that you probably don't have something special for her.  Then, you will need to check to see what type of disc you have.  Many external DVD/CD players will read and write CD but not write DVD.  There are CDs CD - r and CD - RW.  CD - RW is to be formatted, but normally you don't format CD - r.  You just need to copy and paste to, click the disk, and then open Windows Explorer, on the drive, and you should see something like a list of files waiting to be burned to a disc.  Should be a button there to burn.

    Now, let me propose an alternative.  An external hard drive is much better for purposes of backup CDs.  You can buy 500 GB for $70, and 1,5 to ones for about $ these days $100.  You can also buy flash drives.  You can get a 16 GB one for $10.  These would be at least 1600 pictures.  You can also buy 32 GB for $20 flash drives.

    I hope this helps.  Good luck.

  • iMessage how can I add my daughters phone numbers devices if we all share the same Apple I

    IMessage how can I add my daughters phone number to view its iMessages? We all use my Apple ID.

    I used to be able to see the iMessages of my daughter on my phone, but all of a sudden I stopped to get her imessages.

    Have you checked his phone to make sure it has the Apple ID shared signed in Messages? (Settings > Messages). If it doesn't have the same ID, but the number is not displayed in your mailing list & receive, can have its sign on Messages and then again in.

    See you soon,.

    GB

  • How can I add whatsapp for my I look if I can see the text messages and respond

    How can I add whatsapp for my I look if I can view and respond to messages?

    Hello

    WhatsApp WhatsApp Messenger Messenger doesn't offer not currently support Apple Watch, is not currently possible to reply to messages on Apple Watch WhatsApp.

    However, your watch can still be configured to reflect the application from your iPhone notification alerts:

    -On your iPhone, in the application of Eve, go to: My Watch (tab) > Notifications > list of applications > turn on the button next to WhatsApp Messenger.

    When the developer adds support for Apple Watch, description of the application in the iTunes Store / App Store will be changed to include the wording: «Offer Apple Watch App for iPhone»

    You can contact the developer to suggest they add this feature:

    https://www.WhatsApp.com/contact/

    More information:

    https://iTunes.Apple.com/GB/app/WhatsApp-Messenger/id310633997?Mt=8

  • How can I add a 'Record number' column in a folder that contains the music?

    How can I add a 'Record number' column for my music files?  It does not appear as a column I add when I right click on the folder in its display of details.  Zune program uses this file attribute.

    I learned from this thread (http://social.technet.microsoft.com/Forums/en/w7itpromedia/thread/47e46e5a-63c0-4a92-b39d-64ea9a07953e) Windows Media Player 12 IS NOT only an attribute of disc number!  Incredible.  Zune has it, and it works fine.   Come on Microsoft, please join us in THIS century it please?

  • How can I add hair lights to make of this new part of the image hair

    Basically, I do this, as a favor for my girlfriends Santa secret where I shopped picture the face of the person in this picture of Mary Berry and Paul Hollywood. The problem I have is the hair that I had put on it seem natural because I don't know how to add light effects to make it look as if its on the same angle as the rest of the photo.

    I just started using Photoshop for the first time a few months ago so I'm a complete novice, so any help with this would be greatly appreciated, I'm sure that the light of the sun comes from the top of the left side.

    not finished helen.jpg

    Hey anubis,

    Please see the tutorial below that is associated with the same.

    http://www.photoshopessentials.com/photo-editing/hair-color/

    10Steps.SG - Photoshop tutorials and resources

    Change hair color in Photoshop

    Hope that helps.

    Kind regards

    ~ Mohit

  • How can I add my class so I can see their progress in the learning analytics dashboard?

    How can I add students to my class so I can see their progression in the Analytics of Learning Adobe dashboard?

    Also, where can I find the link for the e-seminar session organized by Allen Partridge on 10 July, entitled "Apprenant Intervention & courses in e-Learning Collaboration", where the learning analytics dashboard has been discussed?  A search in the Adobe website ends in a dead end.

    s http://www.Adobe.com/cfusion/event/index.cfm?event=register_no_session&ID=2265781&loc=en_u

    Tapped with my monkey wrench - the link above should solve the problem.

    -Allen

  • How to easily add Facebook, Digg, Twitter, share (for e-mail links) to the page...

    Hello

    I would like to add a few of these 'Like' Facebook, Digg, Twitter, buttons etc. for a customer.

    I looked on Facebook and I think I can get the code here for Facebook; but, what I need to do this for each site? Or is there a place where I can get the code to add more of these links at once? You know the kind where you click on a 'like' button and a pop-up up window where you add your user name and password for the service that you want to connect to...

    (Sorry, I'm a former graphic designer trying to offer web services.) It seems that I still have to learn things everywhere. So, if you could, be a little deeper. (Thank you!)

    http://www.AddThis.com/

  • How can I automatically get a new tab always be a copy of the current active tab?

    The extension add-on "NewTabURL' (from"sogame") provided the option I want to and used for a number of years. But it has stopped working when Firefox has been updated to version 16.0. When I click to a new tab, all I get is a completely blank tab. How can I automatically have the new tab always be a copy of the current active tab?

    The extension "NewTabURL" can be revised to work in version 16 or 17? If not, if not, how can I get the new functionality of the tab I want? I can't find another extension that provides this feature.

    Milt Beychok

    Yes, the balls are always a problem because they do not have three buttons on the mouse and you cannot Middle-click.

    You can always try to click on the "Restore default" button in the window customize if you want to have all the toolbar buttons in the default position.

Maybe you are looking for