Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Insert into Medium Time Date/Time field in Access

Posted on 2003-11-12
3
Medium Priority
?
1,248 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 1000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

721 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