Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Like problem

Author  Topic 

klapy
Starting Member

4 Posts

Posted - 2006-04-13 : 04:19:32
What I want to do is insert all old entrys of a certain table into another table...

I tried a lot of things, nothing works.

Something like this should work, but it doesnt.

SELECT *
FROM tblAV
WHERE tblAV.[Datum uitleen] LIKE '%2006';

Date is formatted like: d/m/y and I want to move ALL entry's of a certain year to another table.

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-04-13 : 04:52:19
SELECT *
FROM tblAV
WHERE year(tblAV.[Datum uitleen]) = '2006'
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-13 : 05:45:35
quote:
Originally posted by shallu1_gupta

SELECT *
FROM tblAV
WHERE year(tblAV.[Datum uitleen]) = '2006'



You dont need to use single quote around year
FROM tblAV
WHERE year(tblAV.[Datum uitleen]) = 2006


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

klapy
Starting Member

4 Posts

Posted - 2006-04-13 : 06:44:36
Well that worked, thnx for that :)

Now the next problem it needs to be inserted into another table

I have:
INSERT INTO tblAVoud
SELECT *
FROM tblAV
WHERE (((Year([tblAV].[Datum uitleen]))=[Typ het jaar in]));

but this gives some strange error that a certain field doesnt exist (which is true), but this field doesnt exist in both tables, so it shouldnt be asking for it....

edit: found the problem, the field DOES exist in 1 table, but not in the other...

Problem I'm working in a replica and the original doesnt exist anymore, so there is no way to change this.... Right?

edit2, even that is solved now.... It works thanks!
Go to Top of Page
   

- Advertisement -