Aggregating two values correlating to different datefields within the same month in a chart

  • Hi All,

    I please need help with how I can write to query to acheive what is written below:

    I need compare two values together within the same month in a chart but the problem is that these two values correlated to two different Date fields in two different tables. I.e.

    Value 1 is the amount paid by Customers daily in a Month. The date field that correlates to this value is called Payment Date

    Value 2 is the amount we have been able to successfully take from the bank after the Customer has made a payment. The date field that correlates to this is called Date Taken

    Now I need to compare in a chart the Amount that has been paid by Customers and the Amount we have actually been able to get from the bank within the same month.

    The Challenge here is how I can aggregate two values within the Same Month on a Chart when they correlate to two date fields.

    Please I need comments. Thank you.

  • Need more info. Please post DDL for tables, DML for test data, queries you have tried so far and expected results.

    Reference: qa.sqlservercentral.com/articles/Best+Practices/61537/[/url]

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • jd_ajy (6/1/2011)


    Please I need comments. Thank you.

    I ... think I kind of understand what you're trying to do, but can't quite wrap my head around it.

    As mentioned above, please post some sample DDL/data for us to work from and what exact results you'd like from said data.

    I'm relatively sure we will just need to show you how to do monthly groupings but I'm not quite sure.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply