473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 5515
debasisdas
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
missinglinq
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

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

Similar topics

11
by: Eugenio | last post by:
Excuse me in advance fo my little English. I've got this stored procedure **************************************************************************** ********** declare @Azienda as...
3
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
5
by: Gregg | last post by:
Hello all, I have been banging my head over a problem that I am having reading a comma seperated file (CSV) that can contain from 1 to 10,000 records. My code snipit is as follows: **Start...
7
by: smith_lannynospam | last post by:
I was wondering if it is possible to create simple queries with the data included in the select statement, similar to how you use the word VALUES (x1,x2,...) in in INSERT statement. The reason I...
7
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
4
by: Andy_Khosravi | last post by:
I'm trying to build a search utility for users to find 'inquiries' in my database that involves several tables. This is normally easy to do with the query builder, but I have a unique situation...
0
by: Chuck36963 | last post by:
Hi all, I've been working on a listing problem and I can't figure out how to work it out. I have looked far and wide on the web to find answers, but I'd like other peoples input on my project in...
8
by: MLH | last post by:
I would like to modify the following SQL... INSERT INTO tblPmtsRcd (VehicleJobID, PmtAmt) SELECT GetCurrentVehicleJobID() AS MyVehicleJobID, !! AS MyPmtAmt; somehow so that an extra field in...
11
by: kabradley | last post by:
Hello Everyone, So, thanks to nico's help I was finally able to 'finish' our companies access database. For the past week or so though,I have been designing forms that contain a subform and an...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.