Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing Dates, Times, etc.(i.e. > or <)

Status
Not open for further replies.

xtreme1

Programmer
May 27, 2000
51
US
&nbsp;&nbsp;&nbsp;&nbsp;Hey guys, having some problems comparing dates.&nbsp;&nbsp;When using the &quot;&gt;&quot; or &quot;&lt;&quot; symbols, the dates are usually compared by what seems like the first 2 digits?&nbsp;&nbsp;In some cases the comparison seems to actually follow no logical pattern what-so-ever.&nbsp;&nbsp;I have figured out how I can sort SQL queries by time, which allows organized &quot;per stop&quot; reports in sequential order from morning to night.&nbsp;&nbsp;Before you can use ASC in your SQL query though, it seems you need to use:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Format([YourTimeFrame], &quot;hh:nn&quot;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Is anyone aware of a better method?&nbsp;&nbsp;It seems that even with this formatting in my code, comparisons like the following still do not work.<br><br>If Format([TimeShouldBeThere], &quot;hh:nn&quot;) &gt; Format(Time(), &quot;hh:nn&quot;) Then<br>your_late = True<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I appreciate any experiences with this problem shared with me, I'm sure it will be helpful.&nbsp;&nbsp;Thanks!<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <p>xtreme1<br><a href=mailto:rbio@excite.com>rbio@excite.com</a><br><a href= > </a><br>
 
What is hh:nn? I thought it was hh:mm. It can't be as simple as that, right? Are you sure you have them formatted as time and not text?<br> <p> <br><a href=mailto:techsupportgirl@home.com>techsupportgirl@home.com</a><br><a href= </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top