One-To-Many: SQL or Procedural Code.

  • Thread starter (PeteCresswell)
  • Start date
P

(PeteCresswell)

Got a table with Dates, Types, and Amounts.
Types are Longs like 1, 2, 3, 4.
Dates are.... well, dates.... as in "02/05/2007".

Call it Table_A

Sometimes the dates are contiguous for a given Type, other times
they are non-contiguous.

I want to create another table, call it Table_B with contiguous
dates for each Type where the Type/Amount from the preceding date
are cloned if there is no Table_A record for that Type/Date.

My kneejerk is to write procedural VBA code to loop through
Table_A, and do comparisons on curType/curDate vs
prvType/prvDate.

But I have to wonder if there is a faster/more efficient solution
using SQL.

Is SQL the Good-Right-And-Holy path here? Or is it procedural
code the appropriate tool?
 
P

(PeteCresswell)

Per (PeteCresswell):
Is SQL the Good-Right-And-Holy path here? Or is it procedural
code the appropriate tool?

I withdraw the question.

The procedural code runs plenty fast enough.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top