Solved

Insert into Medium Time Date/Time field in Access

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now