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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The Date of ColdFuision

Status
Not open for further replies.

oceandeep

IS-IT--Management
Jul 6, 2000
69
GR
i got a problem of saving date into access2000 database:<br>whatever I enter the date like 10/07/2000, 07/10/2000, or 10-Jul-2000, CF will save as like 1899-12-30.<br>The code is as below:<br>Page 1:<br>&lt;cfform action=&quot;DateTestAct.cfm&quot; method=&quot;post&quot;&gt;<br>&lt;cfinput type=&quot;text&quot; size=&quot;20&quot; name=&quot;DateTx&quot;&gt;&lt;br&gt;<br>&lt;cfinput type=&quot;text&quot; size=&quot;20&quot; name=&quot;testTx&quot;&gt;<br>&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;&gt;<br>&lt;/cfform&gt;<br><br>Action page for page1:<br><br>&lt;cfquery datasource=&quot;...&quot; name=&quot;DateTest&quot;&gt;<br>insert into DateTest<br>(&lt;cfif isDate(DateTx)&gt;TestDate,&lt;/cfif&gt;test)<br>values(&lt;cfif isDate(DateTx)&gt;#dateFormat(DateTx,&quot;mm/dd/yyyy&quot;)#,&lt;/cfif&gt;'#testTx#');<br>&lt;/cfquery&gt;<br><br>If anybody can help me? Thanks a lot!<br>
 
Access stores dates in ODBC format.&nbsp;&nbsp;There's nothing you can do about that unless you change the column attribute from date to text, but you can output your date any way you like using the dateformat function (&lt;cfoutput&gt;#dateformat(date,&quot;mm/dd/yyyy&quot;)#&lt;/cfoutput&gt; or &lt;cfoutput&gt;#dateformat (date,&quot;dddd, mmmm d, yyyy&quot;)#&lt;/cfoutput&gt;, etc.).<br><br>If you are viewing your table from within Access and want to see your dates in a certain format, go to the design view of your table and in the format field, type in a filter.&nbsp;&nbsp;(Check Access help for formatting options)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top