Select All From One Table That Are Not In Another

i have to tables:

table 1
FID
username

Table 2
FID
filename
display name

i need to show all fids from table 2 that are not in table 1 for username justin.

View Replies


ADVERTISEMENT

Querying Two Table In One Select

Is there any way to quiry two tables in one select command to limit the number of database connections. One quire displays members from a members list the other quires achievments for each member. i.e.

select name, memberno from memberlist
then select * from achievements where member = memberno

currently this is done by a loop which requires lots of connections

View Replies View Related

Complete An Access Table Through A Select List

I would like to know if it is possible to fill in an access table through a select list inside an APS 3 web page. If yes, how ?

View Replies View Related

How Can I SELECT By Two Fields In A Linked Table (2 Degrees Away)?

How can I do this in a single query (or query-subquery)?

Return the Rows of all books in the CATALOG that...

- are tagged with one category

- are also tagged with a second category

CONTEXT:
This is a 3-table db
Many-to-many (each book may have many categories & v.v.)

- bookCatalog is the main table (with fields for each book's unique data, primary key is Ref_no)

- bookCategoriesLinkTbl is the linking table (it has two fields: category_ID and Ref_no)

- categoriesTbl has only 2 fields: category_ID and categoryName
It's an Access 97 db Code:

View Replies View Related

Integrating Asp Into A Table To Auto Generate Rows From A Select Statement

Im running a select statement to a database and wish to display the relevant records into a table. For some reason, its not liking this - can someone see why, and or tell me an easier way to produce an 'automatically generating' table of results.

<% @language="vbscript" %>
<% Option Explicit %>
<% Response.Buffer=True %>
<html>
<head>
<title>Search Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<!-- #include file="dbConn.asp" -->
<!-- #include file="adovbs.inc"-->
<h1>Your search results returned the following popup messages:</h1>
<% Dim msgtype, title, message, url
msgtype=request.form("type")
title=request.form("title")
message=request.form("msg")
url=request.form("URL")

Dim adoDB, adors, strSQL
set adoDB = Server.CreateObject("ADODB.Connection")
adoDB.Open strConnection
set adoRS = Server.CreateObject("ADODB.RecordSet")
strSQL="SELECT PID,P_TITLE,P_MSG,P_URL,P_TYPE FROM POPUP WHERE ("
If msgtype <> "" then
strSQL=strSQL & "P_TYPE='" & msgtype & "' "
If title <> "" then
strSQL=strSQL & "OR P_TITLE LIKE '%" & title & "%' "
If message <> "" then
strSQL=strSQL & "OR P_MSG LIKE '%" & message & "%' "
If url <> "" then
strSQL=strSQL & "OR P_URL LIKE '%" & url & "%' "
End if
strSQL=strSQL & ")"


'DEBUG ONLY!!
'response.write strSQL
'response.end

adoRS.Open strSQL, adoDB
' Loop through the recordset to display the records
Do While Not adoRS.EOF
& " <tr> " &
& " <td> " & Response.Write adoRS.Fields("PID").Value & " </td> "
& " <td> " & Response.Write adoRS.Fields("P_TYPE").Value & " </td>"
& " <td> " & Response.Write adoRS.Fields("P_TITLE").Value & "</td>"
& " <td> " & Response.Write adoRS.Fields("P_MSG").Value & "</td>"
& " <td> " & Response.Write adoRS.Fields("P_URL").Value & "</td></tr>"
adoRS.MoveNext
Loop
& " </table> " &


' Tidy up afterwards
adoRS.Close
Set adoRS = Nothing
adoDB.Close
Set adoDB = Nothing

%>

</body>
</html>

View Replies View Related

How To Transfer Records From One Table Of A Database To Another Table In Another Data

I have aproblem to transfer a data from table x to table y based on id. Its mean when 2 table have same id all data table x must move to table y. I don't know which command need to use is it insert into or update?

<%
Dim conn
Dim rs
Dim MYSQL,MYSQL2

Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Set cmd = Server.CreateObject("ADODB.Recordset")
conn.ConnectionString = "DSN=prmm;UID=administrator;pwd=sa"
conn.Open

startdate=request("tarikh1")
enddate=request("tarikh2")

MYSQL = "SELECT * FROM table_x where paymentdate between '" & tarikh1 & "' and '" & tarikh2 & "'"
rs.open MYSQL,conn ....

View Replies View Related

How To Open A Recordset For A Table Has Space In The Table NAME?

I am trying to display the content of a Table called

'Order Detail' directly from the database (e.g., Northwind.mdb). I have the following commands:

Set tableSet = Server.CreateObject("ADODB.Recordset")

tableSet.Open table_name, DB_name, adOpenForwardOnly, _
adLockOptimistic, adCmdTable

where, table_name = ''Order Detail" Or
table_name = 'Order Detail' Or different variations.

I always get error on the second command with the following message:
Syntax error in query. Incomplete query clause

which I believe because of space in the Table Name. How can I resolve this issue? (working with file or table name with space)?

View Replies View Related

Table Inside A Table Update To DB

I have a table with many txt boxes which i have inside a form with a submit button to an update page which adds all the details to a db. The problem is i have a another table inside the first e.g. table 2. i want to be able to update table2 by clicking a second submit button that would update it. Is it possible to have a form within a form or how can i do it??

Also i need to update the entire table in one go. For exampple if i have 3 records in table2 i want to be able to update them all by clicking the one update button. Code:

View Replies View Related

Copying From Table 1 Inserting In Table 2

I have the following code but this is inserting manually. I want to make a query from table 1 and automatically enter the records into table 2. What needs to be modified? Code:

View Replies View Related

Bookmarking A Position In A Table <table>

Have an app which dynamically creates table rows depending on records, these can be several hundred (don't ask). Hence a very long page at time. Each row includes a hyper link to a new page, and a link back to the original page.

Is there any method (maybe via js) where on leaving the second page l can redirect the browser to the table row the end user clicked on? Hence the bookmarking. Can do this via Visual Basic on the desktop app, but can't work it out on the web app.

View Replies View Related

How To Get Data From A Table Into A Table Form?

I have a table produced with names across the top and services down the left hand side with boxes for numbers for people who recieve services then the info is written into a table in an access db. That works fine and here is that code:

View Replies View Related

Best Method Of Updating Table From 2nd Table

I have two tables. Table A has 20,000 records, Table B has 2,000 records. Table A is what needs to be updated from the data in Table B. Only some fields will be updated and of course, only some records - both tables have the same field as a ClientID so matching up records should be easy.

Anyways, been a while since I have used ASP to work on things like this but would like to work through this one. I understand the process I believe, it is just how to make it go on to the next record once it has finished updating the first.

Basically, I was thinking of having it set up to reaad the top record from Table B, update applicable data in Table A. Delete that record in Table B. Move on to the next.

View Replies View Related

Error Using <select></select>

I have written some code which should dynamically build a table which is then populated with questionas and possible answers. The format of the answers will vary ie they may be in the form of a radio button which will be rated from 1-5, checkbox or a selectbox.

The first problem I have is if I do not comment out <select></select> I get an error message saying the page can not be found. when I do take it out I get asp timeout. Code:

View Replies View Related

Record Set For Id From Table 1 To Table 2

Hello I have a page for registering users.

I am reciveing this error:

The following errors occured:
- An error occured. -2147217904 : No value given for one or more required parameters.

there are students and teachers. therefore I have 3 tables one for logins and one for staff and on for students.

I have a form designed to capeture the need information.

in the code I am runing an if and elseif statmetn to determin the tables. I then insert the userid and password into the login table.

then i enter the remaining information into ither the staff or student table. what i am trying to do is select the perimary number that is generated as the userid and passeword are enterd. and add this to the second table. Code:

View Replies View Related

How To Make Column Of Table 1 = To Column Of Table 2?

I want MS Access 2000 database column of table 1 = column of table 2. This is what I was doing: Code:

View Replies View Related

Select

does anyone know what I have wrong with this select in my form?

<%
sql = "SELECT * FROM [LTAB_CAProcessArea]"
Set ProcessAreaRS = Server.CreateObject("ADODB.Recordset")
ProcessAreaRS.Open sql, SessionCPRDBConnection, adOpenStatic, adLockOptimistic, adCmdText
%>

<select name="processarea">
<%
Do While Not ProcessAreaRS.EOF
Resonse.Write("<option name='" & ProcessAreaRS("processareaID") & "'>")
Response.Write(ProcessAreaRS("txtProcessArea"))
Response.Write("</option>")

View Replies View Related

<select> Help

I don't know if this is in the right section. I hope it is.I have an HTML document that uses tables and stuff. I also have a FORM on there with some input boxes, Radio buttons and <select> options.
I have a .asp VB file also that processes the actual form and writes the answered questions to a text file on the server (tab separated)
My problem:
The input boxes and radio buttons work fine. It writes to the text file on the sever end.

My problem is I am not too sure how to go making the answers from the <select> options to also write to the server. They way I have it set up right now, it jsut writes "NULL" on the text file.

View Replies View Related

SELECT Last Vs SELECT Max

I've recently come across using "Select Last" in an sql query. Does anyone have any info or views on using it? Until now I've relied on "Select Max" but Select Last would have distinct advantages when using random autonumbers. I'm also curious about why there is so little info on it - perhaps I'm looking in the wrong places?

View Replies View Related

[Select][Value]

I want to display an editable page extract from MS Access table. Now I want to show the value in Select list, extract from another table. Both tables are joinable with the foreign key.

In simplest, I want to extract and display the exact value from a table and show in Select list for edit.

I could not think of any way. I can bring up data and display in Select list but it would display the first value in the list only.

View Replies View Related

Select

i want to select all ids from table1 where those id's arent in table2
Sounds simple and iam sure could be possible in a single sql statement

View Replies View Related

SELECT TOP 50

I have the following SQL SELECT statement below that doesn't like the TOP 50 parameter. When I remove it, all is good. When I put it back I get "Incorrect syntax near '50'".
Code:
SELECT TOP 50 SSN, LName, FName, License_Certificate, Character_Identifier, CertificateNo, " & _
"tblIndividualInfo.IndividualID, tblLicense.LicenseID FROM tblIndividualInfo " & _
"INNER JOIN (tblLicense INNER JOIN stblLicenseType ON tblLicense.LicenseTypeID = stblLicenseType.ID) ON " & _
tblIndividualInfo.IndividualID = tblLicense.IndividualID " & strWhere & " ORDER BY LName, FName

View Replies View Related

Select Box

how to insert multiple items in a select box into a database. For example:

<select multiple name="ComservGroupAge" size="3">
<option value="Children">Children </option>
<option value="Adolescents">Adolescents </option>
<option value="Adults">Adults </option>
<option value="Does Not Matter">Does Not Matter</option>
</select>

I don't want it to go into my db column as one long field.

View Replies View Related

Select Sum

for this part. can i use

select sum (orderqty) from custorder

i attach a pic file to show wat i wanted to do
a few data will be listed out
i want the total from that particular few records only. not the whole records in database

View Replies View Related

SQL SELECT

I know this is an ASP forum but I've also gotten answers to my SQL problems here and I'd appreciate your help very much.
I have these two tables in SQL. Both tables have the same two columns (Description and SiebelName). I want to some how write a script that will look for the descriptions that matches the ones in Table1 with the ones in Table2 and if there are any I would like to take the column in Table2, SName, and update the column in Table1, SiebelName, with that of Table2.
Here's what I attempted to do but it's not working:
--------------------------------
UPDATE tbl_MasterTEST
SET tbl_MasterTEST.SiebelName = Siebel.SName WHERE (SELECT tbl_MasterTEST.ProdDesc, tbl_MasterTEST.SiebelName, Siebel.SDesc, Siebel.SName
FROM tbl_MasterTEST, Siebel
WHERE tbl_MasterTEST.ProdDesc = Siebel.SDesc)

View Replies View Related

For Each And Select

strSQL = "SELECT * FROM mod48 WHERE N_GEN = 5"
oRs.open strSQL,oConn,3

this table has alot of fields. I want it to automatically create alot of Text boxes for each field. But i also need the fields names. The only thing is that the field names in the table are well not very user friendly.

n_gen = General Numer
pa_name = Client Name
pa_surname = Client SurName

So i was wondering is there something i can do. Like a For each that will create alot of tect boxes for each field "with its value in it" and also make it write a description for the lable. Code:

View Replies View Related

Select Max 2x

Ik want to select 2 MAX values form one table, but i don't know how that works, and i can't find it anywhere.

This is what i got so far:

sql = "SELECT max(tekstindex), max(volgnummer) FROM menu"

I want to select max(tekstindex) as 'tekst' and max(volgnummer) as 'volg'.

View Replies View Related

Select

I have a select statement that searches for certain records within a date range entered through a form. what i need to do on another page is count how many records they are and split them into each day within that date range. My original select query is:
Code:


objRSError.Source = "SELECT TOP 100 PERCENT TrapPage, TrapLine, COUNT(TrapID) AS ErrorVol, TrapDescription, TrapASPDescription, TrapCategory FROM dbo.tblErrorTraps WHERE (TrapTime >= CONVERT(DATETIME, '" & objRSError__strFrom & "', 103)) AND (TrapTime <= CONVERT(DATETIME, '" & objRSError__strTo & "', 103))GROUP BY TrapPage, TrapLine, TrapDescription, TrapASPDescription, TrapCategory ORDER BY COUNT(TrapID) DESC"

View Replies View Related

Select

For instance i do write out such which works.Code:

SELECT TOP 5 * FROM table4 order by id desc

Now how would i select the rest of the records without the first 5.

View Replies View Related

Two Select

I have problem, i'm starting using asp and DB

I have query

sSQL = " SELECT count(*) cc FROM ... " &_
" SELECT count(*) ff FROM ... "

Set oRS = oConn.Execute(sSQL)

First count i can get from oRS.("cc")

How to get "ff"?

View Replies View Related

SELECT AND DML

I have an ASP application.Is it right that I am calling all SELECT's AND DML's through stored procedures and in the ASP page I just call the stored procedure.

I am NOT using COM,i.e.I am not calling the procedures through DLL's but directly through ASP as time does not permit me to add this layer.

tell me is this right and is this a common practise followed i.e.calling stored procedures directly thru ASP without COM.Also,what is the main benifit of using SP than dynamic queries as there are plenty of suggestions dont know what is the conclusion.

View Replies View Related

SELECT TOP 10

how to filter top 10 records from the recordset. In Access I could use "SELECT TOP 10..." but in ASP it doesn't work.

View Replies View Related

Select On Day

I have a database containing information in different fields one of those fields is a datetime field, i want to select everything from that table where the datetime field is a monday or tuesday etc.

View Replies View Related

Select ID

if the user select the EmployeeID in drop down list, and then click the submit button, and it will look up database and show the Employee Name in the text box, this is easy.

But my case is: when the user select the employeeid in drop down list, it willfire the onchange event, and then look up database and show the employee name in the text box. There is no submit button.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved