Print Page | Close Window

Date Comparing

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=28094
Printed Date: 28 March 2026 at 5:59pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Date Comparing
Posted By: bsy
Subject: Date Comparing
Date Posted: 03 December 2009 at 3:15am
Hi all,

I'm 1st time ASP classic user. Need ASP expert guidance. Embarrassed

I got a table called 'peakprice'.

FromDate         ToDate              PriceUSD         Peak
2010-09-01      2010-09-15      1,220.00          High
2010-09-16      2010-12-16      977.00             Low
2010-08-01     2010-08-31       1,460.00          Peak
.
.
.
.
.

i want to compare all the date from peakprice table.  01-Sept-2010 to 21-Sept-2010 for both peaks if its falls on that date category....

E.g:

For the rental period from 1st Sept – 21st Sept 2010

1st – 15th Sept 2010 - USD 1,220 (High) USD 1,220 x 15 Days = 18,300

16th – 21st Sept 2010– USD 977 (Low) USD 977 x 5 Days = 4,885

Total: USD 23,185

---------------------------------------------------------------------------------------------------

Should i put the date compare in here after THEN?

This is my code:

If Not rsSP2.EOF Or Not rsSP2.BOF Then
                                               
                                                peakprice = rsSP2.Fields.Item("Price").Value
                                                peakpriceusd = rsSP2.Fields.Item("PriceUSD").Value
                                                   
                                                peakrate = rsSP2.Fields.Item("Peak").Value
                                                   
                                                peakprice = peakprice * mydatediff
                                                peakpriceusd = FormatNumber(CInt(peakpriceusd), 2) * mydatediff
                                                'peakpriceusd = peakpriceusd * mydatediff
                                                   
                                                peakprice = FormatNumber(peakprice, 2)
                                                peakpriceusd = FormatNumber(CInt(peakpriceusd), 2)
                                                   
                                                exchangerate = rsvillarate.Fields.Item("Rate").Value
                                                   
                                                     
                                        End if



Any one can help?

Thanks a lot.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net