469,338 Members | 8,424 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,338 developers. It's quick & easy.

Query input must contain at least one table or query

hi all

I am tring to insert a values to a table by checking if the value is there in the table already

but it gives me this error

"Query input must contain at least one table or query"

here is my query

insert into details values('6025','12/21/2009',' 9:07:57 AM','HP.Color_LaserJet_555_PCL_6','2','Document 3, dotNET Size in bytes: 192548; pages printed: 2')
where details.Date1 not in ( select Date1 from details where details.Date1 = '12/21/2009') AND details.Time not in ( select Time from details where details.Time = ' 9:07:57 AM')
Dec 21 '09 #1
3 5211
8,127 Expert 4TB
You can't use a WHERE clause in an INSERT statement.
Dec 21 '09 #2
hi thanks for the replay

is there any other alterative for this
Dec 23 '09 #3
3,532 Expert 2GB
DLookup() is normally used to check for values in a query or table. You can use an If...Then construct to see if the record already exists before trying to create the new record. DLookup() can have a two part Criteria.

Welcome to Bytes!

Linq ;0)>
Dec 23 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by Eugenio | last post: by
3 posts views Thread by Harvey | last post: by
7 posts views Thread by smith_lannynospam | last post: by
4 posts views Thread by Andy_Khosravi | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.