Date Comparing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eileenbsy99
    New Member
    • Nov 2009
    • 3

    #1

    Date Comparing

    Hi all,

    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

    i want to compare date from this 01-Sept-2010 to 21-Sept-2010, the amount must be "USD23,185" 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

    Anyone can do this?

    Thanks a lot
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    You'll want to look into the DateDiff function

    Comment

    Working...