|
Posted by Tom Moreau on 10/01/37 11:40
Please don't multi-post. I answered this in
microsoft.public.sqlserver.programming.
--
Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"woodfoot" <jdperry784@yahoo.com> wrote in message
news:Xns977055E12663Ejamesperrycomcastnet@216.196.97.136...
Having a brain cramp here and don't know where to start. I have 2 tables:
vehicles and vehicle_useage. What I would like to do is this:
For each distinct vehicle in the vehicle table, I want to make entries
for each day of the month taken from a given date. This routine will be
scheduled to fire off once a month and populate the vehicle_useage table
with vehicle use_dates for each day of the current month and for each VIN
from the vehicle table.
vehicle table:
VIN emp_id
------------ ------
VIN123456789 620123
VIN987654321 620123
vehicle_useage table:
use_date VIN miles
----------- ------------ -----
02/01/2006 VIN123456789 0
02/02/2006 VIN123456789 0
02/03/2006 VIN123456789 0
02/04/2006 VIN123456789 0
etc....
02/01/2006 VIN987654321 0
02/02/2006 VIN987654321 0
02/03/2006 VIN987654321 0
02/04/2006 VIN987654321 0
etc...
Much appreciated for any help you can give...
Navigation:
[Reply to this message]
|