Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Location
    Bunker
    Posts
    4

    Unanswered: CurrentReading to PreviousReading

    Hello....Im newbie...here...and to AccXP...(I havent browsed all the threads so excuse my ignorance on the previous queries on this topic if there were..)

    I got assigned on a [Water] Billing ...My problem is how to get CurrentReading to Previous so i could get the ActualConsumption...


    Please...thank you very much....

  2. #2
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447

    Re: CurrentReading to PreviousReading

    Originally posted by Plancii
    Hello....Im newbie...here...and to AccXP...(I havent browsed all the threads so excuse my ignorance on the previous queries on this topic if there were..)

    I got assigned on a [Water] Billing ...My problem is how to get CurrentReading to Previous so i could get the ActualConsumption...


    Please...thank you very much....

    I'm wondering whether anyboby understands your problem. Could you make yourself clear?
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

  3. #3
    Join Date
    Aug 2003
    Location
    Bunker
    Posts
    4
    Sorry..

    This is about monthly water billing assigned to me is school. Meter reading usually is done every first week of the month (e.g. July 1, Aug 1, Sept 1, etc.)

    My problem is I dunno how to obtain the Consumption (=CurrentMonthReading - PreviousMonthReading) since I got only one field for Reading.

    I dunno how to convert the current monthly reading as the previous reading (e.g. Aug1 Reading is current now but will become previous by Sept 1.)

    I hope I am clear now. My instructor said its very easy...BUt i dont get it. I must be a moron or something....Please, help me....

    I got 2 more days before the deadline....Please....thank you very much..

  4. #4
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447
    You have to compare the actual value with the value of the previous month? Join the table with itself like

    SELECT CurrentMonth.MeterValue - PreviousMonth.MeterValue
    FROM Reading As CurrentMonth, Reading As PreviousMonth
    WHERE CurrentMonth.MeterLocation = PreviousMonth.MeterLocation
    AND CurrentMonth.Month = PreviousMonth.Month + 1


    Make sure your month are build like

    Jan 2001 = 1
    Dec 2001 = 12
    Jan 2002 = 13
    ....

    and add your restriction to get the reguired information like

    ... AND CurrentMonth.Month = 34
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

  5. #5
    Join Date
    Aug 2003
    Location
    Bunker
    Posts
    4
    I think this is what i need...

    Thank you so much DB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •