Dave,
Thanks and that did the trick.
This points out a broader aspect of my lack of knowledge. Should we always
identify the variable? I have always worked under the impression that the
first time a variable was used or initialized the type set in the variable
established the variable type. E.g., the following would cast
server.ReadyTime to a datetime variable.
<cfset server.ReadyTime = DateConvert("local2utc", Now())>
Apparently that is not the case. Or is that the case for CF, but then when
we write to a DB we need to format for the DB? This a problem I can't
remember encountering in MS Access or MySQL, but appears to be an issue in
MS SQL2000
Thanks,
Nick
At 08:21 PM 4/3/2005, you wrote:
>"{ts '2005-04-02 18:51:25'}" and "2005-04-02 18:51:25" are not dates: they
>are strings representing dates. The dates those two strings represent are
>identical.
>
>In the database, a date is being stored, not a string. Your database is
>returning the date correctly, just not formatted the way you want it. So
>simply apply the formatting:
>
>createOdbcDateTime(myDate)
>
>-----Original Message-----
>From: Nick Baker [mailto:[EMAIL PROTECTED]
>Sent: Monday, 4 April 2005 8:59 a.m.
>To: CF-Talk
>Subject: Datetime formatting problem.
>
>CFMX 6.1
>MS SQL 2000
>
>Date times are being reformatted or loosing something when stored in db and
>brought back out to variables, i.e.,
>
>{ts '2005-04-02 18:51:25'}is being changed to 2005-04-02 18:51:25
>
>But not all datetimes. Some show up as the original {ts '2005-04-02
>18:51:25'}
>
>I use server variables, and capture many of the variables in a SQL database
>in case of a server failure. When the server comes back on, info is read
>from the DB and restored to the variables.
>
>Here is the format that I used to capture the times
>
><cfset Eventcurrenttime = #DateConvert("local2utc", Now())#>
>
>DB format is "datetime"
>
>Any hints?
>
>Nick
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:201317
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