• Expression Builder (98)

    • This topic has 6 replies, 2 voices, and was last updated 22 years ago.
    Author
    Topic
    #387920

    I am Wanting to enter rental history. With each release# there is a Item daily rental price, release date, and a return date. I want to create a formula that will subtract the release date from the return date, that will give me a total days and then multiple that time the daily rate.
    ItemTotalAmount: CCur([ReturnDate]-[ReleaseDate]*([Day]))
    I’ve even tried it with just SUM, ADS, and about everything I could think of.
    Could you please give me a hand, Thanks.

    Viewing 1 reply thread
    Author
    Replies
    • #678951

      Hello MrJaums,

      Is Day the name of the daily rental price? If so, you may run into trouble, for Day is also a VBA function. Apart from that, the parentheses are not placed quite right. It should be

      ([ReturnDate]-[ReleaseDate])*[Day]

      I don’t know if CCur is really needed here; if so, it becomes

      CCur(([ReturnDate]-[ReleaseDate])*[Day])

    • #678971

      It still Didn’t work. I changed the Day to DailyRate and it didn’t work still. Is there somewhere that explains the different Expression Functions better then what is at the bottom of the builder. Maybe I could make two different fields one to total the number of day past and another that takes the rate and times then days lapsed. I’ve tried even just trying to find total days and I’m having trouble with that too.

      • #678975

        You haven’t made clear what kind of trouble you have: do you get an error message, or do you see something like #Name or #Error instead of a value, or do you see different values than you expected?

        • #678976

          Sorry, #Error

          • #678979

            What happens if you enter

            Duration: [ReturnDate]-[ReleaseDate]

            in a column of the query grid?

            • #679408

              Discussion has continued in the thread starting with post 257354. I’m locking this thread to avoid confusion and duplication.

    Viewing 1 reply thread
    Reply To: Expression Builder (98)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: