If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How do I get "#" around dates in an Insert into query?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-19-09, 04:43
ratbags ratbags is offline
Registered User
 
Join Date: Oct 2009
Posts: 1
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)#)
</CFQuery>
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
Paul
Reply With Quote
  #2 (permalink)  
Old 10-19-09, 05:30
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
###CreateODBCDate(Form.DateInTheatres)###
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On