Professional Web Applications Themes

update date - Coldfusion - Advanced Techniques

I nned my form submit btn to update the datelastupdated column with the correct date i was told i can give my microsoft access date column a current date default value, with this, will it only update when the record is edited, if so how do i set the default value?...

  1. #1

    Default update date

    I nned my form submit btn to update the datelastupdated column with the correct
    date

    i was told i can give my microsoft access date column a current date default
    value,
    with this, will it only update when the record is edited, if so how do i set
    the default value?

    macca2727 Guest

  2. #2

    Default Re: update date

    have query action

    <cfquery name="upddte" datasource="#application.ds#">
    insert into table
    (
    dateviewed
    )
    values
    (
    '#DateFormat(Now(), 'mm/dd/yyyy')#'
    )
    </cfquery>
    jazz823 Guest

  3. #3

    Default Re: update date

    You'd be better off creating a valid date/time object to update your database field:

    CreateODBCDateTime(now())

    -Paul
    dempster Guest

  4. #4

    Default Re: update date

    dont understand where that code would go, how do i set that up and where would i put the code on the action page?
    macca2727 Guest

  5. #5

    Default Re: update date

    in a query

    update mytable
    set datelastupdated = something.

    If your database has a function that returns the current date, use it.
    Otherwise use #createodbcdate(now())#

    Originally posted by: macca2727
    dont understand where that code would go, how do i set that up and where would
    i put the code on the action page?



    Dan Guest

  6. #6

    Default Re: update date

    so do i put this into my action page? so when my form is passed there it updates, if so how do i set a query on a update page?

    i only have cfupdate at the minute
    macca2727 Guest

  7. #7

    Default Re: update date

    Look up cfquery in the cfml reference manual. If you don't have one, google
    <cfquery>

    Originally posted by: macca2727
    so do i put this into my action page? so when my form is passed there it
    updates, if so how do i set a query on a update page?

    i only have cfupdate at the minute



    Dan Guest

  8. #8

    Default Re: update date

    so would it be something like this

    <cfquery name="updatetime" datasource="DPSGuide">
    SELECT *
    FROM Aged_Care_Facility_Details
    </cfquery>

    <cfset #updatetime.DateLastAmended# = #createodbcdate(now())#>

    macca2727 Guest

  9. #9

    Default Re: update date

    No, it would be more like what I posted earlier.

    I suggest you buy this book. http://www.forta.com/books/0672325675/

    Originally posted by: macca2727
    so would it be something like this

    <cfquery name="updatetime" datasource="DPSGuide">
    SELECT *
    FROM Aged_Care_Facility_Details
    </cfquery>

    <cfset #updatetime.DateLastAmended# = #createodbcdate(now())#>



    Dan Guest

Similar Threads

  1. mySQL Update Date
    By woribhabor in forum Coldfusion Database Access
    Replies: 2
    Last Post: January 16th, 04:40 AM
  2. Use a CFC to update a database with a date
    By EdmondsM in forum Coldfusion - Advanced Techniques
    Replies: 6
    Last Post: July 25th, 05:57 PM
  3. Update Access with today's date
    By Durwood Edwards in forum Macromedia Dynamic HTML
    Replies: 5
    Last Post: June 4th, 06:56 PM
  4. Date update?
    By Muscle Doc webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 3
    Last Post: July 22nd, 02:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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