If you do it the way you're doing it, you're comparing strings, not date
objects.  You should take the fields you get from the DB and use
createDateTime() to create a CF datetime object, then compare that to now()
instead of comparing strings.


-Justin Scott



> I'm trying to implement that solution, comparing today's date 
> with a date I 
> have in a database (unfortunately, the DB I inherited has the 
> date stored 
> as individual dd, mm, yy, hh, mm, and ss fields). So I create 
> my date with:
> 
> <cfset endTimeDate= 
> '#qry.applCloseMonth#/#qry.applCloseDay#/#qry.applCloseYear# 
> #qry.applCloseHour#:#qry.applCloseMinute#:#qry.applCloseSecond#'>
> (again, from individual fields in the DB)
> 
> ....and then I create thisDate:
> 
> <cfset thisTime='#DateFormat(Now(), 'mmm/dd/yyyy')# 
> #Hour(Now())#:#Minute(Now())#:#Second(Now())#'>
> 
> ....and although both dates print exactly the same on the screen, the 
> comparison between them does not trigger an "earlier that" or 
> "later than" 
> behavior (I'm using GTE and LTE). Any suggestions on how to 
> make it work 
> (considering how the date is stored in the DB)?
> 
> Thanks in advance,
> 
> Roberto Perez
> [EMAIL PROTECTED]


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:222693
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to