SQLTeam.com | Weblogs | Forums

How to insert new data to a table


#1

hello

i have a table as checkpoints and it has creation date and some other informations and this creation date is a field as date/time
i add data from this table to anothr table, this table has a project name field and for each project i will add the checkpoints from checkpoints table until a specific dtae
this date is a textbox in my form in ms access, but after a while some other data is added to this table and iwant to add them as well but i don't know how. can you help please?

i wrote the follow code but it adds just the new date once but i want to add it for each of my project fields for exxample

insert into checks_projects([Creation date]) select a.[Creation date] from (select [Creation date] from Query2) as a left join checks_projects b on a.[Creation date]=b.[Creation date] where IsNull(b.[Creation date])
can you help please?
i really need it


#2

First do you really need to use a subquery?

We need to know what the tables look like. Creation date should not normally be the join.


#3

the fields in checkpoints are:
id: primary key
checkname
question
epm info
.....some other fields plus creation date
checks_projects
id: it is the primary key
checkid: it is as foreign key here
question
project name
creation date and some other fields


#4

actually in checks_projects table i have different checks for each of the projects
for example project a has check1,check2,check3,.....,check20
and project b has also check1, check2,...,check20,check21
the checkpoints are added based on a text box in a form
they are added based on their creation date and their creation date is less than the value of this text box
can you help please
i thought a lot
but i really don't have an idea
and it is emergency
thank you