inserting system or current date

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default inserting system or current date

    Hello,

    How can I insert system or current date into coldfusion4.5 I wrote this query
    But I am getting error

    <cfquery name="documentation_check" Datasource="spi">
    prc_get_spi_documentation_info #spi_id#
    </cfquery>
    Thanks
    Nike

    akcreative Guest

  2. Similar Questions and Discussions

    1. Current Date
      Good monring, I would like to display the current date and time on the html page preferable with the seconds clicking away to give the page some...
    2. getting the current date
      hi guys I?ve created 3 selection boxes on a form: 1 for the date, with values 1 - 31. 1 for the month, with values 1- 12 1 for the year with...
    3. Simple Problem - Inserting current date into table
      Hello Im trying to create a form in which when someone registers, it also adds the current date into a specified field from a hiddenfield...
    4. Inserting Current Date into MySQL Database
      OK, I am a complete Newbie at this, well... almost... I am creating a database that accepts members. I need to know how to insert the date of...
    5. inserting the current date into mysql database fild
      Hi I'm using DW MX and the php_mysql server model I have generated this code for inserting data into the DB. <code> if...
  3. #2

    Default Re: inserting system or current date

    I'm not using oracle, but to use the database date, I think it's something like:

    INSERT into spi (date_reviewed) SELECT sysdate FROM dual


    mxstu Guest

  4. #3

    Default Re: inserting system or current date

    :beer;
    Have you tried

    <cfquery name="ins" datasource = "spi">
    INSERT into spi (date_reviewed) values #Now()#</cfquery> ?

    King of any skill
    ColdFusion007 Guest

  5. #4

    Default Re: inserting system or current date

    Originally posted by: ColdFusion007
    :beer;
    Have you tried

    <cfquery name="ins" datasource = "spi">
    INSERT into spi (date_reviewed) values #Now()#</cfquery> ?

    King of any skill

    I think you accidentally left out parenthesis around the values.

    INSERT into spi (date_reviewed) values ( #Now()# ) </cfquery>

    NOTE - Just be aware of the difference between the two methods. Using the CF
    function #Now()# would insert the current ColdFusion date and time. SELECT
    sysdate FROM dual would use use the current database date and time. In most
    cases they are probably the same, but not always.




    mxstu Guest

  6. #5

    Default Re: inserting system or current date

    If you are going to use the Cold Fusion now() function, make sure you use the necessary formatting functions to make it acceptable for your database.
    Dan Bracuk Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139