I'm stuck. Could be just because it's late, but I'm not getting anywhere.
I'm writing a scheduling application to make my wife's life a bit
easier. One of the tables will contain standard shift times for
employees, i.e. 7:30-16:00, 8:30-17:00. I use these values to
populate a dropdown that a person's shift can be selected from.
So, I'm trying to store these time values in a SQL Server database.
Table is something like:
tblScheduledTimes
timestart(datetime)
timeend(datetime)
The administrator then enters shift start/end times in HH24:mm format
The problem I am having is on inserting those values into the
database. If I try to insert the value as <cfqueryparam
cfsqltype="CF_SQL_DATE" value="#timeFormat(FORM.timestart)#"> With
debug output turned on, I can see that the value being inserted is {ts
'1899-12-30 16:00:00'}, which is correct (remember, I don't care about
the date, just the time).
However, viewing the actual data in the database, that value is being
stored as 12/30/1899 12:00:00 PM
Anyone have a clue as to why the value being inserted is correct, but
the value being actually stored isn't? Should I be using a different
data type? Should I just store the time value (i.e. 16:00) as a
varchar value and convert it to part of the date when I store the
actual employee schedule time in the schedule table (which is not the
table shown above)?
Thanks,
Pete
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219819
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54