Inserting Records

B

Bre-x

Hi,

I have two pieces of information Start_Date and End_Date

I would like to populate a table with each single date between these values.

Values: 07/10/2007, 7/13/2007

Table:

ID, Mydate
1 07/10/2007
2 07/11/2007
3 07/12/2007
4 07/13/2007


Regards,

Bre-x
 
K

KARL DEWEY

Try this using a table name CountNumber with a field named CountNUM filled
with 0 (zero) to your maximum date spread.
SELECT DateAdd("d",[CountNUM],[Start_Date]) AS Your_Fill_Date INTO
YourDateTable
FROM CountNumber
WHERE (((CountNumber.CountNUM)<=DateDiff("d",[Start_Date],[End_Date])));
 
B

Bre-x

I didnt explain myself very well

The Start_Date and End_Date will be enter by the user, then I would like to
populate the values into my "empy" table.

Thank you

Regards,

Bre-x
 
B

Bre-x

INSERT INTO CountNumber ( CountNUM )
SELECT DateAdd("d",[CountNUM],"07/02/07") AS Your_Fill_Date
FROM CountNumber
WHERE (((CountNumber.CountNUM)<=DateDiff("d","07/02/07","07/05/07")));

like that?

sorry I am having a off day

:p

Bre-x
 
K

KARL DEWEY

Like this ---
INSERT INTO YourDateTable ( Your_Fill_Date )
SELECT DateAdd("d",[CountNUM],[Start_Date]) AS Your_Fill_Date
FROM CountNumber
WHERE (((CountNumber.CountNUM)<=DateDiff("d",[Start_Date],[End_Date])));

--
KARL DEWEY
Build a little - Test a little


Bre-x said:
INSERT INTO CountNumber ( CountNUM )
SELECT DateAdd("d",[CountNUM],"07/02/07") AS Your_Fill_Date
FROM CountNumber
WHERE (((CountNumber.CountNUM)<=DateDiff("d","07/02/07","07/05/07")));

like that?

sorry I am having a off day

:p

Bre-x
 
Top