Solved

Insert into Medium Time Date/Time field in Access

Posted on 2003-11-12
3
1,239 Views
Last Modified: 2013-12-24
hi.  I'm using cfinput to insert a time into an access database.  I was able to make it work on my system, but when i upload it to my server, it doesn't work.  A time gets inserted, but its 12:00 AM for every one.  

Here is the cfinsert statement:

<CFINSERT datasource="db_44" TABLENAME="schedule" DBTYPE="ODBC" FORMFIELDS="completed,opponent,opp_short,gamedate,home_away,location,gametime">

Here is the cfinput:

<cfinput name="gametime" type="text" size="25" required="no">

I have a medium date field in the same form (gamedate) and i had to input the date into the <cfinput> tag as mm/dd/yyyy.  Is there a format i need to follow other than hh:mm tt (9:00 PM)?  

I tried changing the cfinput to input.  Didn't work either.  

Thanks everyone.  
0
Comment
Question by:mikebmassey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
anandkp earned 250 total points
ID: 9737160
I majorly use INPUT instead of CFINPUT

in ur insert query - u can use the following format

<form>
   <input type="text" value="" name="userdatetime"><!--- user enters date time here --->
   <input type="text" value="" name="username">
</form>

<cfquery>
   insert into table (username, userdatetime)
   values (<CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#username#">,
<CFQUERYPARAM CFSQLTYPE="cf_sql_timestamp" VALUE="#userdatetime#"><!--- use cf_sql_date / cf_sql_time if required --->
)
</cfquery>

this shld do it for u

PS : it wld be great if u insert teh datetime from the backend, by using default value as currentdatetime for the field - when a new record is inserted.

HTH

K'Rgds
Anand
0
 

Author Comment

by:mikebmassey
ID: 9768859
You are the coldfusion god!  thanks for all your help.  
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9768944
:)

Cheers
Anand
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question