SQL Query

H

hrider1

Can someone tell me how to change the following query from SQL work in front
page.

WHERE (Shipments.Business_Unit > '[ ]') AND (Shipments.Shipping_Group >
'[ ]') AND (Shipments.Shipper = N'ADP-Logistics')

This is all new to me

Thanks,
Jim
 
S

Stefan B Rusynko

you can't have 2 WHERE
- as in WHERE (WHERE

The < and > implies a non string (numeric) comparison
- so '[ ]' needs to be a numeric value (XX below) w/o a separator
(Shipments.Business_Unit > XX) AND (Shipments.Shipping_Group > XX)

If your Shipper string really has a ' in it you need to convert it to a double '
(Shipments.Shipper = 'N''ADP-Logistics')


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Can someone tell me how to change the following query from SQL work in front
| page.
|
| WHERE (WHERE (Shipments.Business_Unit > '[ ]') AND (Shipments.Shipping_Group >
'[ ]') AND (Shipments.Shipper = N'ADP-Logistics')
AND (Shipments.Shipper = N'ADP-Logistics')
|
| This is all new to me
|
| Thanks,
| Jim
|
|
 
K

Kevin Spencer

Hi Jim,

That all depends on what you mean by "work." First of all, you haven't
posted the whole SQL statement. A SQL statement begins with "SELECT,"
"UPDATE," "INSERT," "DELETE," and a few other commands. What you have posted
is the conditional clause of a SQL statement. Perhaps you know this, but I
can't presume that you do.

As for what I mean by "what you mean by 'work'," What I mean is that what
you've posted, as a WHERE clause, will "work," in that it will not throw an
error, unless one of the column names is misspelled, your data typing syntax
is incorrect, or if you're not querying the "Shipments" table. So, since I
don't know what you're after, I'll tell you what you've posted.

Shipments.Business_Unit > '[ ]'

This means that you are specifying the "Business_Unit" column of the
"Shipping" table.
It also means that the "Business_Unit" column is of a text data type.
Finally, it means that the value in the column must follow "[ ]" in
alphabetical order.

Shipments.Shipping_Group > '[ ]'

This means that you are specifying the "Shipping_Group" column of the
"Shipping" table.
It also means that the "Shipping_Group" column is of a text data type.
Finally, it means that the value in the column must follow "[ ]" in
alphabetical order.

Shipments.Shipper = N'ADP-Logistics'

This means that you are specifying the "Shipper" column of the "Shipping"
table.
It also means that the "Shipper" column is of a text data type.
Finally, it means that the value in the column must be equal to
'ADP-Logistics'
It also specifies Unicode as the character format for the string you're
comparing to.

A few remarks:

Punctuation marks, such as "[" and "]" are alphabetically lower than
numbers, which are alphabetically lower than characters. Therefore, "[ ]"
would be "less than" "[1]" as an example.

Whether the search is case-sensitive would depend on the collation order of
the database. If you want to be sure of case-insensitivity, use the LIKE
operator.

The AND operator indicates that both conditions (or, in your case, all)
must be met.

I'm assuming, mostly due to the use of the "N" Unicode specifier, that
you're using SQL Server, although there are other databases that support
this notation.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

Can someone tell me how to change the following query from SQL work in
front
page.

WHERE (Shipments.Business_Unit > '[ ]') AND (Shipments.Shipping_Group'[ ]') AND (Shipments.Shipper = N'ADP-Logistics')

This is all new to me

Thanks,
Jim
 
H

hrider1

I am selecting data and the Shipments.Business_Unit > '[ ]' is not a null,
but the field is empty along with the other field. What I am trying to do is
only get back fields where both have something in them.

Jim



Kevin Spencer said:
Hi Jim,

That all depends on what you mean by "work." First of all, you haven't
posted the whole SQL statement. A SQL statement begins with "SELECT,"
"UPDATE," "INSERT," "DELETE," and a few other commands. What you have posted
is the conditional clause of a SQL statement. Perhaps you know this, but I
can't presume that you do.

As for what I mean by "what you mean by 'work'," What I mean is that what
you've posted, as a WHERE clause, will "work," in that it will not throw an
error, unless one of the column names is misspelled, your data typing syntax
is incorrect, or if you're not querying the "Shipments" table. So, since I
don't know what you're after, I'll tell you what you've posted.

Shipments.Business_Unit > '[ ]'

This means that you are specifying the "Business_Unit" column of the
"Shipping" table.
It also means that the "Business_Unit" column is of a text data type.
Finally, it means that the value in the column must follow "[ ]" in
alphabetical order.

Shipments.Shipping_Group > '[ ]'

This means that you are specifying the "Shipping_Group" column of the
"Shipping" table.
It also means that the "Shipping_Group" column is of a text data type.
Finally, it means that the value in the column must follow "[ ]" in
alphabetical order.

Shipments.Shipper = N'ADP-Logistics'

This means that you are specifying the "Shipper" column of the "Shipping"
table.
It also means that the "Shipper" column is of a text data type.
Finally, it means that the value in the column must be equal to
'ADP-Logistics'
It also specifies Unicode as the character format for the string you're
comparing to.

A few remarks:

Punctuation marks, such as "[" and "]" are alphabetically lower than
numbers, which are alphabetically lower than characters. Therefore, "[ ]"
would be "less than" "[1]" as an example.

Whether the search is case-sensitive would depend on the collation order of
the database. If you want to be sure of case-insensitivity, use the LIKE
operator.

The AND operator indicates that both conditions (or, in your case, all)
must be met.

I'm assuming, mostly due to the use of the "N" Unicode specifier, that
you're using SQL Server, although there are other databases that support
this notation.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

Can someone tell me how to change the following query from SQL work in
front
page.

WHERE (Shipments.Business_Unit > '[ ]') AND (Shipments.Shipping_Group'[ ]') AND (Shipments.Shipper = N'ADP-Logistics')

This is all new to me

Thanks,
Jim
 
K

Kevin Spencer

Hi Jim,

In fact, ( > '[ ]' ) means "alphabetically after "[ ]". Now, when you say
"not a null," are you sure you mean a null, or a blank string? I ask because
they are entirely different. Here's the syntax for both:

WHERE columnName IS NOT NULL
WHERE columnName <> ''
WHERE columnName != ''

The second and third are functionally equivalent.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

I am selecting data and the Shipments.Business_Unit > '[ ]' is not a null,
but the field is empty along with the other field. What I am trying to do
is
only get back fields where both have something in them.

Jim



Kevin Spencer said:
Hi Jim,

That all depends on what you mean by "work." First of all, you haven't
posted the whole SQL statement. A SQL statement begins with "SELECT,"
"UPDATE," "INSERT," "DELETE," and a few other commands. What you have
posted
is the conditional clause of a SQL statement. Perhaps you know this, but
I
can't presume that you do.

As for what I mean by "what you mean by 'work'," What I mean is that what
you've posted, as a WHERE clause, will "work," in that it will not throw
an
error, unless one of the column names is misspelled, your data typing
syntax
is incorrect, or if you're not querying the "Shipments" table. So, since
I
don't know what you're after, I'll tell you what you've posted.

Shipments.Business_Unit > '[ ]'

This means that you are specifying the "Business_Unit" column of the
"Shipping" table.
It also means that the "Business_Unit" column is of a text data type.
Finally, it means that the value in the column must follow "[ ]" in
alphabetical order.

Shipments.Shipping_Group > '[ ]'

This means that you are specifying the "Shipping_Group" column of the
"Shipping" table.
It also means that the "Shipping_Group" column is of a text data type.
Finally, it means that the value in the column must follow "[ ]" in
alphabetical order.

Shipments.Shipper = N'ADP-Logistics'

This means that you are specifying the "Shipper" column of the "Shipping"
table.
It also means that the "Shipper" column is of a text data type.
Finally, it means that the value in the column must be equal to
'ADP-Logistics'
It also specifies Unicode as the character format for the string you're
comparing to.

A few remarks:

Punctuation marks, such as "[" and "]" are alphabetically lower than
numbers, which are alphabetically lower than characters. Therefore, "[ ]"
would be "less than" "[1]" as an example.

Whether the search is case-sensitive would depend on the collation order
of
the database. If you want to be sure of case-insensitivity, use the LIKE
operator.

The AND operator indicates that both conditions (or, in your case, all)
must be met.

I'm assuming, mostly due to the use of the "N" Unicode specifier, that
you're using SQL Server, although there are other databases that support
this notation.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

in
message news:[email protected]...
Can someone tell me how to change the following query from SQL work in
front
page.

WHERE (Shipments.Business_Unit > '[ ]') AND
(Shipments.Shipping_Group

'[ ]') AND (Shipments.Shipper = N'ADP-Logistics')

This is all new to me

Thanks,
Jim
 
H

hrider1

Thanks, everything works now

Jim

Kevin Spencer said:
Hi Jim,

In fact, ( > '[ ]' ) means "alphabetically after "[ ]". Now, when you say
"not a null," are you sure you mean a null, or a blank string? I ask because
they are entirely different. Here's the syntax for both:

WHERE columnName IS NOT NULL
WHERE columnName <> ''
WHERE columnName != ''

The second and third are functionally equivalent.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

I am selecting data and the Shipments.Business_Unit > '[ ]' is not a null,
but the field is empty along with the other field. What I am trying to do
is
only get back fields where both have something in them.

Jim



Kevin Spencer said:
Hi Jim,

That all depends on what you mean by "work." First of all, you haven't
posted the whole SQL statement. A SQL statement begins with "SELECT,"
"UPDATE," "INSERT," "DELETE," and a few other commands. What you have
posted
is the conditional clause of a SQL statement. Perhaps you know this, but
I
can't presume that you do.

As for what I mean by "what you mean by 'work'," What I mean is that what
you've posted, as a WHERE clause, will "work," in that it will not throw
an
error, unless one of the column names is misspelled, your data typing
syntax
is incorrect, or if you're not querying the "Shipments" table. So, since
I
don't know what you're after, I'll tell you what you've posted.

Shipments.Business_Unit > '[ ]'

This means that you are specifying the "Business_Unit" column of the
"Shipping" table.
It also means that the "Business_Unit" column is of a text data type.
Finally, it means that the value in the column must follow "[ ]" in
alphabetical order.

Shipments.Shipping_Group > '[ ]'

This means that you are specifying the "Shipping_Group" column of the
"Shipping" table.
It also means that the "Shipping_Group" column is of a text data type.
Finally, it means that the value in the column must follow "[ ]" in
alphabetical order.

Shipments.Shipper = N'ADP-Logistics'

This means that you are specifying the "Shipper" column of the "Shipping"
table.
It also means that the "Shipper" column is of a text data type.
Finally, it means that the value in the column must be equal to
'ADP-Logistics'
It also specifies Unicode as the character format for the string you're
comparing to.

A few remarks:

Punctuation marks, such as "[" and "]" are alphabetically lower than
numbers, which are alphabetically lower than characters. Therefore, "[ ]"
would be "less than" "[1]" as an example.

Whether the search is case-sensitive would depend on the collation order
of
the database. If you want to be sure of case-insensitivity, use the LIKE
operator.

The AND operator indicates that both conditions (or, in your case, all)
must be met.

I'm assuming, mostly due to the use of the "N" Unicode specifier, that
you're using SQL Server, although there are other databases that support
this notation.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

in
message Can someone tell me how to change the following query from SQL work in
front
page.

WHERE (Shipments.Business_Unit > '[ ]') AND
(Shipments.Shipping_Group

'[ ]') AND (Shipments.Shipper = N'ADP-Logistics')

This is all new to me

Thanks,
Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top