G
Green Biro
Hi there. Hoping that someone can assit me with this:
Can get recordset of dated orders ie <Date, OrderId, CustomerId, Charge> but
I need to check (and apply) discounts from a discounts table that has the
format <CustomerId, StartDate, EndDate, %age discount> Of course if no
appropruate record were found in the discounts table then the full cost
needs to be charged.
My output needs to be <Date, OrderId, CustomerId, Charge, NewCharge>
I thought about trying to create a temporary 'complete' discounts table with
every possible date and customer combination but I'm sure there's a better
way. Please can someone point me in the right direction.
I would prefer a query that can be represented in Design View but just SQL
will do.
Many thanks.
GB
PS I should add that I will be writing something thet ensures that no
overlapping records can exist in the discounts table
Can get recordset of dated orders ie <Date, OrderId, CustomerId, Charge> but
I need to check (and apply) discounts from a discounts table that has the
format <CustomerId, StartDate, EndDate, %age discount> Of course if no
appropruate record were found in the discounts table then the full cost
needs to be charged.
My output needs to be <Date, OrderId, CustomerId, Charge, NewCharge>
I thought about trying to create a temporary 'complete' discounts table with
every possible date and customer combination but I'm sure there's a better
way. Please can someone point me in the right direction.
I would prefer a query that can be represented in Design View but just SQL
will do.
Many thanks.
GB
PS I should add that I will be writing something thet ensures that no
overlapping records can exist in the discounts table