473,624 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bad Query?

GTi
I have a query like:

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2" FROM "ContactTable", "ProjectMembers ","ContactTable "
"ContactTab le1" WHERE ("ProjectMember s"."ProjectNDX" =4) AND
("ProjectMember s"."ContactN DX" = "ContactTable". "NDX") AND
("ContactTable" ."RefContact " = "ContactTable1" ."NDX")

This works as expected.
But I am concerned about this if the
"ContactTable". "RefContact " = "ContactTable1" ."NDX"
is FALSE. (the RefContact is missing or broked)
The whole query fails.

Is there any way to prevent that the whole quey fails and only return NULL
fields?

Regards
GTi
Jul 23 '05 #1
15 2543
On Fri, 7 Jan 2005 20:34:02 +0100, GTi wrote:
I have a query like:

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2" FROM "ContactTable", "ProjectMembers ","ContactTable "
"ContactTab le1" WHERE ("ProjectMember s"."ProjectNDX" =4) AND
("ProjectMember s"."ContactN DX" = "ContactTable". "NDX") AND
("ContactTable" ."RefContact " = "ContactTable1" ."NDX")

This works as expected.
But I am concerned about this if the
"ContactTable". "RefContact " = "ContactTable1" ."NDX"
is FALSE. (the RefContact is missing or broked)
The whole query fails.

Is there any way to prevent that the whole quey fails and only return NULL
fields?

Regards
GTi


You want LEFT JOIN. While you're at it, change the other table-joining
phrase into an INNER JOIN. It makes it easier to understand which
conditions join tables together and which conditions filter the rows.

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2"
FROM "ProjectMembers "
INNER JOIN "ContactTab le"
ON "ProjectMembers "."ContactN DX" = "ContactTable". "NDX"
LEFT JOIN "ContactTab le1"
ON "ContactTable". "RefContact " = "ContactTable1" ."NDX"
WHERE ("ProjectMember s"."ProjectNDX" =4)
Jul 23 '05 #2
On Fri, 7 Jan 2005 20:34:02 +0100, GTi wrote:
I have a query like:

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable" ."Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1 "."Name2" FROM "ContactTable", "ProjectMembers ","ContactTable "
"ContactTable1 " WHERE ("ProjectMember s"."ProjectNDX" =4) AND
("ProjectMembe rs"."ContactNDX " = "ContactTable". "NDX") AND
("ContactTable "."RefConta ct" = "ContactTable1" ."NDX")

This works as expected.
But I am concerned about this if the
"ContactTable" ."RefContact " = "ContactTable1" ."NDX"
is FALSE. (the RefContact is missing or broked)
The whole query fails.

Is there any way to prevent that the whole quey fails and only return NULL
fields?


Hi GTi,

I don't really understand what you're trying to achieve. Please post
again, supplying
* Table structure (as CREATE TABLE statements, including all constraints
and properties but omitting irrelevant columns - see www.aspfaq.com/5006)
* Sample data that illustrates what you need to get done (posted as INSERT
statements)
* Expected output
* And a description of the business problem you're trying to solve.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 23 '05 #3
GTi
"Ross Presser" <rp******@imtek .com> skrev i melding
news:uw******** *******@rpresse r.invalid...
On Fri, 7 Jan 2005 20:34:02 +0100, GTi wrote:
I have a query like:

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2" FROM
"ContactTable", "ProjectMembers ","ContactTable "
"ContactTab le1" WHERE ("ProjectMember s"."ProjectNDX" =4) AND
("ProjectMember s"."ContactN DX" = "ContactTable". "NDX") AND
("ContactTable" ."RefContact " = "ContactTable1" ."NDX")

This works as expected.
But I am concerned about this if the
"ContactTable". "RefContact " = "ContactTable1" ."NDX"
is FALSE. (the RefContact is missing or broked)
The whole query fails.

Is there any way to prevent that the whole quey fails and only return
NULL
fields?

Regards
GTi


You want LEFT JOIN. While you're at it, change the other table-joining
phrase into an INNER JOIN. It makes it easier to understand which
conditions join tables together and which conditions filter the rows.

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2"
FROM "ProjectMembers "
INNER JOIN "ContactTab le"
ON "ProjectMembers "."ContactN DX" = "ContactTable". "NDX"
LEFT JOIN "ContactTab le1"
ON "ContactTable". "RefContact " = "ContactTable1" ."NDX"
WHERE ("ProjectMember s"."ProjectNDX" =4)


At first I get this error:
ODBC Error: SQLSTATE = S1000, Native error code = 0
Unable to open table: ContactTable1.
No such table or object.

Then I changed it to:
SELECT ProjectMembers. RoleText, ProjectMembers. Description,
ContactTable.Na me1, ContactTable.Na me2, ContactTable1.N ame1,
ContactTable1.N ame2
FROM ProjectMembers, ContactTable, ContactTable1 as ContactTable
INNER JOIN ContactTable ON ProjectMembers. ContactNDX = ContactTable.ND X
LEFT JOIN ContactTable1 ON ContactTable.Re fContact = ContactTable1.N DX
WHERE (ProjectMembers .ProjectNDX=4)

and get this error:
ODBC Error: SQLSTATE = 37000, Native error code = 0
Table reference [ContactTable] must be unique.

Now I'm a stuck newbie.....
What I want....
I want to get a list of all contacts and ref. contacts to that contacts
(nested contacts) that
is connected to a project listed in the ProjectMembers table.
The original scripts works just fine, but I see a problem when a contact is
deleted
(and the ProjectMembers table is not updated) or/and when a contact don't
have
any refContact. Then the whole scrips fails.
If that happen I just want the xx.Name1, xx.Name2 fields left blank/NULL in
the script result
but returns the RoleText and Description from the ProjectMembers table.
Then "someone" can open the records and edit the correct contact.

OK?


Jul 23 '05 #4
Do you mean that the table may be missing? or matching entries in the table?

If you mean entries in the table - a left join will work for ya.

if however the table is missing you will need to use dynamic sql to modify
your query,
or in a seperate step prior to your query make sure its there by creating it
if not.

"GTi" <bi**@gates.com > wrote in message news:3nFDd.668$ VR2.22@amstwist 00...
"Ross Presser" <rp******@imtek .com> skrev i melding
news:uw******** *******@rpresse r.invalid...
On Fri, 7 Jan 2005 20:34:02 +0100, GTi wrote:
I have a query like:

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2" FROM
"ContactTable", "ProjectMembers ","ContactTable "
"ContactTab le1" WHERE ("ProjectMember s"."ProjectNDX" =4) AND
("ProjectMember s"."ContactN DX" = "ContactTable". "NDX") AND
("ContactTable" ."RefContact " = "ContactTable1" ."NDX")

This works as expected.
But I am concerned about this if the
"ContactTable". "RefContact " = "ContactTable1" ."NDX"
is FALSE. (the RefContact is missing or broked)
The whole query fails.

Is there any way to prevent that the whole quey fails and only return
NULL
fields?

Regards
GTi


You want LEFT JOIN. While you're at it, change the other table-joining
phrase into an INNER JOIN. It makes it easier to understand which
conditions join tables together and which conditions filter the rows.

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2"
FROM "ProjectMembers "
INNER JOIN "ContactTab le"
ON "ProjectMembers "."ContactN DX" = "ContactTable". "NDX"
LEFT JOIN "ContactTab le1"
ON "ContactTable". "RefContact " = "ContactTable1" ."NDX"
WHERE ("ProjectMember s"."ProjectNDX" =4)


At first I get this error:
ODBC Error: SQLSTATE = S1000, Native error code = 0
Unable to open table: ContactTable1.
No such table or object.

Then I changed it to:
SELECT ProjectMembers. RoleText, ProjectMembers. Description,
ContactTable.Na me1, ContactTable.Na me2, ContactTable1.N ame1,
ContactTable1.N ame2
FROM ProjectMembers, ContactTable, ContactTable1 as ContactTable
INNER JOIN ContactTable ON ProjectMembers. ContactNDX = ContactTable.ND X
LEFT JOIN ContactTable1 ON ContactTable.Re fContact = ContactTable1.N DX
WHERE (ProjectMembers .ProjectNDX=4)

and get this error:
ODBC Error: SQLSTATE = 37000, Native error code = 0
Table reference [ContactTable] must be unique.

Now I'm a stuck newbie.....
What I want....
I want to get a list of all contacts and ref. contacts to that contacts
(nested contacts) that
is connected to a project listed in the ProjectMembers table.
The original scripts works just fine, but I see a problem when a contact
is deleted
(and the ProjectMembers table is not updated) or/and when a contact don't
have
any refContact. Then the whole scrips fails.
If that happen I just want the xx.Name1, xx.Name2 fields left blank/NULL
in the script result
but returns the RoleText and Description from the ProjectMembers table.
Then "someone" can open the records and edit the correct contact.

OK?

Jul 23 '05 #5
GTi
One guy told me that top posting is perilous, so look at the bottom.

"David Rawheiser" <ra*******@hotm ail.com> skrev i melding
news:KJ******** ***********@bgt nsc05-news.ops.worldn et.att.net...
Do you mean that the table may be missing? or matching entries in the
table?

If you mean entries in the table - a left join will work for ya.

if however the table is missing you will need to use dynamic sql to modify
your query,
or in a seperate step prior to your query make sure its there by creating
it if not.

"GTi" <bi**@gates.com > wrote in message
news:3nFDd.668$ VR2.22@amstwist 00...
"Ross Presser" <rp******@imtek .com> skrev i melding
news:uw******** *******@rpresse r.invalid...
On Fri, 7 Jan 2005 20:34:02 +0100, GTi wrote:

I have a query like:

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2",
"ContactTable1" ."Name1",
"ContactTable1" ."Name2" FROM
"ContactTable", "ProjectMembers ","ContactTable "
"ContactTab le1" WHERE ("ProjectMember s"."ProjectNDX" =4) AND
("ProjectMember s"."ContactN DX" = "ContactTable". "NDX") AND
("ContactTable" ."RefContact " = "ContactTable1" ."NDX")

This works as expected.
But I am concerned about this if the
"ContactTable". "RefContact " = "ContactTable1" ."NDX"
is FALSE. (the RefContact is missing or broked)
The whole query fails.

Is there any way to prevent that the whole quey fails and only return
NULL
fields?

Regards
GTi

You want LEFT JOIN. While you're at it, change the other table-joining
phrase into an INNER JOIN. It makes it easier to understand which
conditions join tables together and which conditions filter the rows.

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2"
FROM "ProjectMembers "
INNER JOIN "ContactTab le"
ON "ProjectMembers "."ContactN DX" = "ContactTable". "NDX"
LEFT JOIN "ContactTab le1"
ON "ContactTable". "RefContact " = "ContactTable1" ."NDX"
WHERE ("ProjectMember s"."ProjectNDX" =4)


At first I get this error:
ODBC Error: SQLSTATE = S1000, Native error code = 0
Unable to open table: ContactTable1.
No such table or object.

Then I changed it to:
SELECT ProjectMembers. RoleText, ProjectMembers. Description,
ContactTable.Na me1, ContactTable.Na me2, ContactTable1.N ame1,
ContactTable1.N ame2
FROM ProjectMembers, ContactTable, ContactTable1 as ContactTable
INNER JOIN ContactTable ON ProjectMembers. ContactNDX = ContactTable.ND X
LEFT JOIN ContactTable1 ON ContactTable.Re fContact = ContactTable1.N DX
WHERE (ProjectMembers .ProjectNDX=4)

and get this error:
ODBC Error: SQLSTATE = 37000, Native error code = 0
Table reference [ContactTable] must be unique.

Now I'm a stuck newbie.....
What I want....
I want to get a list of all contacts and ref. contacts to that contacts
(nested contacts) that
is connected to a project listed in the ProjectMembers table.
The original scripts works just fine, but I see a problem when a contact
is deleted
(and the ProjectMembers table is not updated) or/and when a contact don't
have
any refContact. Then the whole scrips fails.
If that happen I just want the xx.Name1, xx.Name2 fields left blank/NULL
in the script result
but returns the RoleText and Description from the ProjectMembers table.
Then "someone" can open the records and edit the correct contact.

OK?



I mean that if the matching entries in the table is missing (not the whole
table).
Example:
ContactTable.Re fContact = ContactTable1.N DX

if ContactTable.Re fContact IS 0 / NULL
or ContactTable.Re fContact have a value to a non existing record (NDX).


Jul 23 '05 #6
On Sat, 8 Jan 2005 00:58:59 +0100, GTi wrote:
At first I get this error:
ODBC Error: SQLSTATE = S1000, Native error code = 0
Unable to open table: ContactTable1.
No such table or object.

(snip)

Hi GTi,

Your original query was very hard to read, due to formatting, over-using
of double-quotes and omitting the AS keyword (I know it's optional, but
including it just makes your query so much better to read!)

Try modifying Ross' suggestion to:

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2"
FROM "ProjectMembers "
INNER JOIN "ContactTab le"
ON "ProjectMembers "."ContactN DX" = "ContactTable". "NDX"
LEFT JOIN "ContactTab le" AS "ContactTab le1"
ON "ContactTable". "RefContact " = "ContactTable1" ."NDX"
WHERE ("ProjectMember s"."ProjectNDX" =4)

Or, better yet:

SELECT ProjectMembers. RoleText, ProjectMembers. Description,
ContactTable.Na me1, ContactTable.Na me2,
ContactTable1.N ame1, ContactTable1.N ame2
FROM ProjectMembers
INNER JOIN ContactTable
ON ProjectMembers. ContactNDX = ContactTable.ND X
LEFT JOIN ContactTable AS ContactTable1
ON ContactTable.Re fContact = ContactTable1.N DX
WHERE ProjectMembers. ProjectNDX = 4

Or (even better in my opinion, but some would disagree):

SELECT p.RoleText, p.Description,
c.Name1, c.Name2,
c1.Name1, c1.Name2
FROM ProjectMembers AS p
INNER JOIN ContactTable AS c
ON c.NDX = p.ContactNDX
LEFT JOIN ContactTable AS c1
ON c1.NDX = c.RefContact
WHERE p.ProjectNDX = 4
Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 23 '05 #7
GTi
"Hugo Kornelis" <hugo@pe_NO_rFa ct.in_SPAM_fo> skrev i melding
news:5s******** *************** *********@4ax.c om...
On Sat, 8 Jan 2005 00:58:59 +0100, GTi wrote:
At first I get this error:
ODBC Error: SQLSTATE = S1000, Native error code = 0
Unable to open table: ContactTable1.
No such table or object.

(snip)

Hi GTi,

Your original query was very hard to read, due to formatting, over-using
of double-quotes and omitting the AS keyword (I know it's optional, but
including it just makes your query so much better to read!)

Try modifying Ross' suggestion to:

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2"
FROM "ProjectMembers "
INNER JOIN "ContactTab le"
ON "ProjectMembers "."ContactN DX" = "ContactTable". "NDX"
LEFT JOIN "ContactTab le" AS "ContactTab le1"
ON "ContactTable". "RefContact " = "ContactTable1" ."NDX"
WHERE ("ProjectMember s"."ProjectNDX" =4)

Or, better yet:

SELECT ProjectMembers. RoleText, ProjectMembers. Description,
ContactTable.Na me1, ContactTable.Na me2,
ContactTable1.N ame1, ContactTable1.N ame2
FROM ProjectMembers
INNER JOIN ContactTable
ON ProjectMembers. ContactNDX = ContactTable.ND X
LEFT JOIN ContactTable AS ContactTable1
ON ContactTable.Re fContact = ContactTable1.N DX
WHERE ProjectMembers. ProjectNDX = 4

Or (even better in my opinion, but some would disagree):

SELECT p.RoleText, p.Description,
c.Name1, c.Name2,
c1.Name1, c1.Name2
FROM ProjectMembers AS p
INNER JOIN ContactTable AS c
ON c.NDX = p.ContactNDX
LEFT JOIN ContactTable AS c1
ON c1.NDX = c.RefContact
WHERE p.ProjectNDX = 4
Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)


I love the last one, It look nice and it is easier to read.
And it give me the result I wanted.
If I change the line
ON c1.NDX = c.RefContact
to
ON c1.NDX = 9999999 // or 0

Is still gives me the records but with no refContact.

Love it.
Thanks Hugo!


Jul 23 '05 #8
GTi
"Hugo Kornelis" <hugo@pe_NO_rFa ct.in_SPAM_fo> skrev i melding
news:5s******** *************** *********@4ax.c om...
On Sat, 8 Jan 2005 00:58:59 +0100, GTi wrote:
At first I get this error:
ODBC Error: SQLSTATE = S1000, Native error code = 0
Unable to open table: ContactTable1.
No such table or object.

(snip)

Hi GTi,

Your original query was very hard to read, due to formatting, over-using
of double-quotes and omitting the AS keyword (I know it's optional, but
including it just makes your query so much better to read!)

Try modifying Ross' suggestion to:

SELECT "ProjectMembers "."RoleText ", "ProjectMembers "."Description" ,
"ContactTable". "Name1", "ContactTable". "Name2", "ContactTable1" ."Name1",
"ContactTable1" ."Name2"
FROM "ProjectMembers "
INNER JOIN "ContactTab le"
ON "ProjectMembers "."ContactN DX" = "ContactTable". "NDX"
LEFT JOIN "ContactTab le" AS "ContactTab le1"
ON "ContactTable". "RefContact " = "ContactTable1" ."NDX"
WHERE ("ProjectMember s"."ProjectNDX" =4)

Or, better yet:

SELECT ProjectMembers. RoleText, ProjectMembers. Description,
ContactTable.Na me1, ContactTable.Na me2,
ContactTable1.N ame1, ContactTable1.N ame2
FROM ProjectMembers
INNER JOIN ContactTable
ON ProjectMembers. ContactNDX = ContactTable.ND X
LEFT JOIN ContactTable AS ContactTable1
ON ContactTable.Re fContact = ContactTable1.N DX
WHERE ProjectMembers. ProjectNDX = 4

Or (even better in my opinion, but some would disagree):

SELECT p.RoleText, p.Description,
c.Name1, c.Name2,
c1.Name1, c1.Name2
FROM ProjectMembers AS p
INNER JOIN ContactTable AS c
ON c.NDX = p.ContactNDX
LEFT JOIN ContactTable AS c1
ON c1.NDX = c.RefContact
WHERE p.ProjectNDX = 4
Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)


Hugo,
I can improve it if I only use LEFT JOIN:
LEFT JOIN ContactTable AS c
LEFT JOIN ContactTable AS c1

LEFT JOIN:
"The LEFT JOIN returns all the rows from the first table , even if there are
*no matches* in the other tables"

INNER JOIN:
"The INNER JOIN returns all rows from both tables where there is a match. If
there are rows in ProjectMembers that do not have matches in ContactTable,
those rows will *not* be listed. "

http://www.w3schools.com/sql/sql_join.asp

If so, I think I got the understanding of the JOINING stuff...
Or?


Jul 23 '05 #9
On Sat, 8 Jan 2005 23:32:47 +0100, GTi wrote:

(snip)

Hugo,
I can improve it if I only use LEFT JOIN:
LEFT JOIN ContactTable AS c
LEFT JOIN ContactTable AS c1


Hi GTi,

Whether that's an improvement or not depends on your requirements - if one
of the join types would always be better, the other wouldn't have been
implemented. :-)

The first question is: does your business allow ProjectMembers not to have
a ContactNDX (whatever that may be)? If the answer is no, then the second
question is: are you concerned that your table might have ProjectMembers
without ContactNDX? If the answer to this question is yes, then your table
design is failing to enforce a business rule. You should first take steps
to find and correct any rows with data in violation of the business rule,
then set a NOT NULL constraint on the ContactNDX column to make sure that
the business rule is enforced henceforth.

The first question is: does your business allow ProjectMembers to have a
ContactNDX that is not present in the ContactTable table? If the answer is
no, then the second question is: are you concerned that your table might
have ProjectMembers with a ContactNDX that's missing from the ContactTable
table? If the answer to this question is yes, then your table design is
failing to enforce a business rule. You should first take steps to find
and correct any rows with data in violation of the business rule, then set
a FOREIGN KEY constraint on the ContactNDX column to make sure that the
business rule is enforced henceforth.

You now have ensured that your business rules are properly enforced by
database constraints. Now, you can use these business rules to decide how
to write your query. Again, we start with a question: Will every row in
the ProjectMembers table always have a value for ContactNDX, AND will this
value always be present in the ContactTable table? If the answer is yes,
then there is no need to use a LEFT JOIN here. The results will not be any
different from those of an INNER JOIN, but the query will be harder to
process for SQL Server.
However, if the answer is that there can be rows in ProjectMembers with no
matching row in ContactTable (either because ContactMDX is NULL or because
it is not present in ContactTable), then the next question would be if
these rows need to be included in the results of your query. If they
should appear (with NULLS in the columns from ContactTable), then you need
a LEFT JOIN; if they should not appear, then you must use INNER JOIN.

</lecture>

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3425
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the new values are updated in all corresponding tables (the function of the pages in question). However, on the page that does the DB update, I also want to do some checks on the data before performing the update. Now, the problem that I am...
29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" & REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("GenKTitles.
9
3121
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use SUBSTRING(ProductName, 1, CHARINDEX('(', ProductName)-2). I can get this result, but I had to use several views (totally inefficient). I think this can be done in one efficient/fast query, but I can't think of one. In the case that one query is not...
3
5381
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 there is a sample file called Ixtrasp.asp, but I could not find it in my system although I installed indexing service. I followed the steps in MSDN site to create a basic .asp query form (too long to post it here), but it always displays: No...
4
2142
by: Diamondback | last post by:
I have two tables, WIDGETS and VERSIONS. The WIDGETS table has descriptive information about the widgets while the VERSIONS table contains IDs relating to different iterations of those widgets over the years. The idea is that from any widget in the database you can look forward and backward to see different versions of the widget through the years. Here are the tables: WIDGETS widget_id name
14
3878
by: Dave Thomas | last post by:
If I have a table set up like this: Name | VARCHAR Email | VARCHAR Age | TINYINT | NULL (Default: NULL) And I want the user to enter his or her name, email, and age - but AGE is optional. My insert would look something like:
0
3497
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list boxes do not necessarily need to have a selection made to be used in the dynamic query. In essence the form can have selections made in all or none of its list boxes to form the dynamic query I am looking to get some feedback in reference to...
6
4837
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID SalesManName AT Alan Time
4
3124
by: Stan | last post by:
I am using MS Office Access 2003 (11.5614). My basic question is can I run a query of a query datasheet. I want to use more that one criteria and can not get that query to work. I thought I might be able to accomplish the results in two steps by using two queries. If this is possible how can I do it? Thank you, Stan Hanna
6
4395
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one field between them. The join field in both tables are indexed and I'm selecting 1 field from each table to lookup. The Access query is taking more than 60 second to retrieve 1 record and if I execute the same query within the Query Analyzer, it...
0
8173
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8679
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8621
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8475
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.