D
Dave
Maybe this is simple, I don't know. I have a SQL server
stored procedure (that I can't modify or have modified)
which returns all of the customer's orders since some
date. For example, when I execute the stored procedure I
give a date as part of the procedure. Then the store
procedure returns: the Customer Name, Order Date, and
Order Value. Depending on the date entered and the
customer, there could be from 0 to whatever records
returned for a customer. Having no records for a
particular customer isn't an issue, but if there are
multiple records what I really want is just the most
recent record. This most recent record is the one I want
(for each custormer).
Is there an easy way to do this? I need to save the most
recent record for each customer in another table for use
in a separate application but the number of customers
which might return a record is variable and the number or
records each customer may return is variable. I could do
this in VBA code using record comparisons but this sounds
like it would be VERY slow given that just a couple of
days may be a total of a couple of thousand records and
often we may want the most recent records from over a week
ago.
TIA for any help,
Dave
stored procedure (that I can't modify or have modified)
which returns all of the customer's orders since some
date. For example, when I execute the stored procedure I
give a date as part of the procedure. Then the store
procedure returns: the Customer Name, Order Date, and
Order Value. Depending on the date entered and the
customer, there could be from 0 to whatever records
returned for a customer. Having no records for a
particular customer isn't an issue, but if there are
multiple records what I really want is just the most
recent record. This most recent record is the one I want
(for each custormer).
Is there an easy way to do this? I need to save the most
recent record for each customer in another table for use
in a separate application but the number of customers
which might return a record is variable and the number or
records each customer may return is variable. I could do
this in VBA code using record comparisons but this sounds
like it would be VERY slow given that just a couple of
days may be a total of a couple of thousand records and
often we may want the most recent records from over a week
ago.
TIA for any help,
Dave