Solved

Insert into Medium Time Date/Time field in Access

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

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…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

810 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