Solved

Insert into Medium Time Date/Time field in Access

Posted on 2003-11-12
3
1,236 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

762 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