Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009

    Unanswered: How do I get "#" around dates in an Insert into query?

    I am trying to use the "Insert Into" type "CFQUERY" and insert a date into a field.This date has been input by the user on a web form using the syntax "<input type="text" name="DateInTheatres"...>
    The query is
    <CFQuery datasource="blah">
    Insert into Films(<other fields>,DateInTheatres)
    values(<other fields>,#CreateODBCDate(Form.DateInTheatres)#)
    The above code does not seem to work because the "#" are not automatically put to the left & right of the date so when the sql resolves you get 12/10/2009 (for example) no quotes, nothing.
    How can I fix this?
    many thanks

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    ###CreateODBCDate(Form.DateInTheatres)### | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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