I don't think I've ever seen that before... Is a date time value even meant
to be converted to a float? Perhaps you're loosing some kind of precision
when you're converting... (possibly 2 days worth?).
Try converting to a double, or why would you convert a date/time value to a
float in the first place? We store all the date times as integers with the
datediff('s',application.startdate,now()) to convert the date to numbers...
Russ
> -----Original Message-----
> From: Richard Dillman [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 19, 2006 5:07 PM
> To: CF-Talk
> Subject: Why does this happen with SQL Server 2000 and CFML?
>
> <cfquery name="qryDate" datasource="#request.dsn#">
> Select convert(float,getdate()) as datetimefromdb
> </cfquery>
>
> <cfoutput query="qryDate">
> display that with: #val(datetimefromdb - 0)#
> Returns 38734.6939544 (or whatever date/time it is)
>
> display that with: #dateformat(val(datetimefromdb-0), "dd-mmm-yy")#
> Returns 17-Jan-06 (what? thats 2 days ago)
> </cfoutput>
>
> Now use select getdate() as datetimefromdb in your Query
>
> <cfquery name=qryDate" datasource="#request.dsn#">
> select getdate() as datetimefromdb
> </cfquery>
>
> <cfoutput query="qryDate">
> display that with: #val(datetimefromdb - 0)#
> Returns 38736.6939468 (hrm differen date)
>
> display that with: #dateformat(val(datetimefromdb-0), "dd-mmm-yy")#
> Returns 19-Jan-06 (success todays date)
> </cfoutput>
>
> But why would i get 2 different dates?
>
>
> --
> Richard Dillman
>
> "The most important step is always the first one."
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230058
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