Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to concatenate date and insert

Status
Not open for further replies.

Chloeee

Programmer
Jan 16, 2001
27
0
0
US
I am passing a date from a form in 2 parts (month and year)

The following code is giving me an error. The error is related to the date. Any ideas?

Code:
<cfif isDefined(&quot;Form.addrecord&quot;)>
  <cfset theDate = CreateDate(Form.theYear, Form.theMonth, 1)>
  <cfquery name=&quot;insert_newsletter&quot; datasource=&quot;thedatesource&quot; dbtype=&quot;ODBC&quot;>
    INSERT INTO Newsletter(NewsletterDate, NewsletterTitle) 
	VALUES ('#theDate#','#Form.NewsletterTitle#')
  </cfquery>  
</cfif>
 
Okay, Okay...

I fixed my own problem at long last by removing the single quotes from #theDate#.

I thought I'd post the solution for future archive search for others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top