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.
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 tblAVWHERE 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 tblAVWHERE year(tblAV.[Datum uitleen]) = '2006' |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-13 : 05:45:35
|
quote: Originally posted by shallu1_gupta SELECT *FROM tblAVWHERE year(tblAV.[Datum uitleen]) = '2006'
You dont need to use single quote around yearFROM tblAVWHERE year(tblAV.[Datum uitleen]) = 2006MadhivananFailing to plan is Planning to fail |
 |
|
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 tableI have:INSERT INTO tblAVoudSELECT *FROM tblAVWHERE (((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! |
 |
|
|
|
|