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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing Dates 1

Status
Not open for further replies.
Jan 26, 2001
550
GB
Hi guys, this is probably pretty simple but i can't work it out...

I have an access database with a list of products, with normal and promotional prices. The products also contain start and end dates for being on promotion.

I am displaying the products from the database in a table and need to work out whether each specific product is within its promotion dates, and if so highlight it.

I guess its something to do with the datediff function but i can't figure out precisely how to get this result...

Any help would be vastly appreciated. Nick (Web Designer)


nick@retrographics.co.uk
 
something like this might be ok for you

Code:
<%
While NOT objRecordset.EOF
  If ((objRecordset(&quot;FirstDate&quot;) <= Now) AND (objRecordset(&quot;LastDate&quot;) >= Now)) Then
    'highlighted version here
  Else
    'normal version here
  End If

  objRecordset.MoveNext
Wend
%>
Tony
reddot.gif WIDTH=400 HEIGHT=2 VSPACE=3

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top