Database results error

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I am trying to reuse part of an existing custom query on
a new database results field on a new page. However, I
always get an error even though I think I am using the
exact same syntax as before.

I am trying to pull only the first 175 characters from a
database field (called "Article"). To do it, I am
reusing this part of a custom query that already works on
a different page: Format Left([Article], 175)
AS "MyArticle"

The new page always generates an error in the FrontPage
Database Properties wizard, and displays this message
when I preview a page in a browser: "Database Results
Error Description: [Microsoft][ODBC Microsoft Access
Driver] Syntax error (missing operator) in query
expression 'Format Left([Article], 175)'."

Any suggestions?
 
What is your complete Query string?

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
Here is the whole query:

SELECT *, Format Left([Article], 175) AS "MyArticle" FROM
Articles WHERE (PublishNow = 1) AND ("Article Date"
Between Date()-9 AND Date( )) AND ("Silicon" = 1) OR
("Article Date" < Date( )-10) AND ("Silicon" = 1) ORDER
BY "Article Date" DESC

-----Original Message-----
What is the whole query?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

I am trying to reuse part of an existing custom query on
a new database results field on a new page. However, I
always get an error even though I think I am using the
exact same syntax as before.

I am trying to pull only the first 175 characters from a
database field (called "Article"). To do it, I am
reusing this part of a custom query that already works on
a different page: Format Left([Article], 175)
AS "MyArticle"

The new page always generates an error in the FrontPage
Database Properties wizard, and displays this message
when I preview a page in a browser: "Database Results
Error Description: [Microsoft][ODBC Microsoft Access
Driver] Syntax error (missing operator) in query
expression 'Format Left([Article], 175)'."

Any suggestions?


.
 
What's "Format" for?

Bob Lehmann

Paul said:
Here is the whole query:

SELECT *, Format Left([Article], 175) AS "MyArticle" FROM
Articles WHERE (PublishNow = 1) AND ("Article Date"
Between Date()-9 AND Date( )) AND ("Silicon" = 1) OR
("Article Date" < Date( )-10) AND ("Silicon" = 1) ORDER
BY "Article Date" DESC

-----Original Message-----
What is the whole query?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

I am trying to reuse part of an existing custom query on
a new database results field on a new page. However, I
always get an error even though I think I am using the
exact same syntax as before.

I am trying to pull only the first 175 characters from a
database field (called "Article"). To do it, I am
reusing this part of a custom query that already works on
a different page: Format Left([Article], 175)
AS "MyArticle"

The new page always generates an error in the FrontPage
Database Properties wizard, and displays this message
when I preview a page in a browser: "Database Results
Error Description: [Microsoft][ODBC Microsoft Access
Driver] Syntax error (missing operator) in query
expression 'Format Left([Article], 175)'."

Any suggestions?


.
 
Format is what I have used in the past to truncate the
number of characters returned from a specific field. For
some reason, it's not working in this case.

Format Left([Article], 175) AS "MyArticle" gives me the
first 175 characrers of the Article field on other pages I
have.

Is there another way to truncate a field full of a lot of
text to a specific length?
-----Original Message-----
What's "Format" for?

Bob Lehmann

Here is the whole query:

SELECT *, Format Left([Article], 175) AS "MyArticle" FROM
Articles WHERE (PublishNow = 1) AND ("Article Date"
Between Date()-9 AND Date( )) AND ("Silicon" = 1) OR
("Article Date" < Date( )-10) AND ("Silicon" = 1) ORDER
BY "Article Date" DESC

-----Original Message-----
What is the whole query?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

I am trying to reuse part of an existing custom query on
a new database results field on a new page. However, I
always get an error even though I think I am using the
exact same syntax as before.

I am trying to pull only the first 175 characters
from
a
database field (called "Article"). To do it, I am
reusing this part of a custom query that already
works
on
a different page: Format Left([Article], 175)
AS "MyArticle"

The new page always generates an error in the FrontPage
Database Properties wizard, and displays this message
when I preview a page in a browser: "Database Results
Error Description: [Microsoft][ODBC Microsoft Access
Driver] Syntax error (missing operator) in query
expression 'Format Left([Article], 175)'."

Any suggestions?


.


.
 
Yes,

Trim(Left(

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================


Paul said:
Format is what I have used in the past to truncate the
number of characters returned from a specific field. For
some reason, it's not working in this case.

Format Left([Article], 175) AS "MyArticle" gives me the
first 175 characrers of the Article field on other pages I
have.

Is there another way to truncate a field full of a lot of
text to a specific length?
-----Original Message-----
What's "Format" for?

Bob Lehmann

Here is the whole query:

SELECT *, Format Left([Article], 175) AS "MyArticle" FROM
Articles WHERE (PublishNow = 1) AND ("Article Date"
Between Date()-9 AND Date( )) AND ("Silicon" = 1) OR
("Article Date" < Date( )-10) AND ("Silicon" = 1) ORDER
BY "Article Date" DESC


-----Original Message-----
What is the whole query?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

message
I am trying to reuse part of an existing custom query
on
a new database results field on a new page. However, I
always get an error even though I think I am using the
exact same syntax as before.

I am trying to pull only the first 175 characters from
a
database field (called "Article"). To do it, I am
reusing this part of a custom query that already works
on
a different page: Format Left([Article], 175)
AS "MyArticle"

The new page always generates an error in the FrontPage
Database Properties wizard, and displays this message
when I preview a page in a browser: "Database Results
Error Description: [Microsoft][ODBC Microsoft Access
Driver] Syntax error (missing operator) in query
expression 'Format Left([Article], 175)'."

Any suggestions?


.


.
 
Note: I have only used Trim when displaying the field content on the page,
not within the actually query.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================


Thomas A. Rowe said:
Yes,

Trim(Left(

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================


Paul said:
Format is what I have used in the past to truncate the
number of characters returned from a specific field. For
some reason, it's not working in this case.

Format Left([Article], 175) AS "MyArticle" gives me the
first 175 characrers of the Article field on other pages I
have.

Is there another way to truncate a field full of a lot of
text to a specific length?
-----Original Message-----
What's "Format" for?

Bob Lehmann

Here is the whole query:

SELECT *, Format Left([Article], 175) AS "MyArticle" FROM
Articles WHERE (PublishNow = 1) AND ("Article Date"
Between Date()-9 AND Date( )) AND ("Silicon" = 1) OR
("Article Date" < Date( )-10) AND ("Silicon" = 1) ORDER
BY "Article Date" DESC


-----Original Message-----
What is the whole query?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

message
I am trying to reuse part of an existing custom query
on
a new database results field on a new page. However, I
always get an error even though I think I am using the
exact same syntax as before.

I am trying to pull only the first 175 characters from
a
database field (called "Article"). To do it, I am
reusing this part of a custom query that already works
on
a different page: Format Left([Article], 175)
AS "MyArticle"

The new page always generates an error in the FrontPage
Database Properties wizard, and displays this message
when I preview a page in a browser: "Database Results
Error Description: [Microsoft][ODBC Microsoft Access
Driver] Syntax error (missing operator) in query
expression 'Format Left([Article], 175)'."

Any suggestions?


.



.
 
Thomas, thanks for your suggestion. I'm not sure I fully
understand the syntax, particularly where I place the
name of the field and where I specify the number of
characters I want left after the "trim." If I want to be
left with the first 150 characters from the field
Article, would it be:

Trim(Left(Article),150)
-----Original Message-----
Note: I have only used Trim when displaying the field content on the page,
not within the actually query.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

Thomas A. Rowe said:
Yes,

Trim(Left(

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

Format is what I have used in the past to truncate the
number of characters returned from a specific field. For
some reason, it's not working in this case.

Format Left([Article], 175) AS "MyArticle" gives me the
first 175 characrers of the Article field on other pages I
have.

Is there another way to truncate a field full of a lot of
text to a specific length?

-----Original Message-----
What's "Format" for?

Bob Lehmann

message
Here is the whole query:

SELECT *, Format Left([Article], 175) AS "MyArticle"
FROM
Articles WHERE (PublishNow = 1) AND ("Article Date"
Between Date()-9 AND Date( )) AND ("Silicon" = 1) OR
("Article Date" < Date( )-10) AND ("Silicon" = 1) ORDER
BY "Article Date" DESC


-----Original Message-----
What is the whole query?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

message
I am trying to reuse part of an existing custom query
on
a new database results field on a new page.
However, I
always get an error even though I think I am using
the
exact same syntax as before.

I am trying to pull only the first 175 characters
from
a
database field (called "Article"). To do it, I am
reusing this part of a custom query that already
works
on
a different page: Format Left([Article], 175)
AS "MyArticle"

The new page always generates an error in the
FrontPage
Database Properties wizard, and displays this message
when I preview a page in a browser: "Database Results
Error Description: [Microsoft][ODBC Microsoft Access
Driver] Syntax error (missing operator) in query
expression 'Format Left([Article], 175)'."

Any suggestions?


.



.


.
 
Trim(Left(recordset("fieldname"),150))

Will get you the first 150 characters of the field.

If the above doesn't work try

Trim(Left(recordset("fieldname",150))
--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================


Paul said:
Thomas, thanks for your suggestion. I'm not sure I fully
understand the syntax, particularly where I place the
name of the field and where I specify the number of
characters I want left after the "trim." If I want to be
left with the first 150 characters from the field
Article, would it be:

Trim(Left(Article),150)
-----Original Message-----
Note: I have only used Trim when displaying the field content on the page,
not within the actually query.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

Thomas A. Rowe said:
Yes,

Trim(Left(

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

Format is what I have used in the past to truncate the
number of characters returned from a specific field. For
some reason, it's not working in this case.

Format Left([Article], 175) AS "MyArticle" gives me the
first 175 characrers of the Article field on other pages I
have.

Is there another way to truncate a field full of a lot of
text to a specific length?

-----Original Message-----
What's "Format" for?

Bob Lehmann

message
Here is the whole query:

SELECT *, Format Left([Article], 175) AS "MyArticle"
FROM
Articles WHERE (PublishNow = 1) AND ("Article Date"
Between Date()-9 AND Date( )) AND ("Silicon" = 1) OR
("Article Date" < Date( )-10) AND ("Silicon" = 1) ORDER
BY "Article Date" DESC


-----Original Message-----
What is the whole query?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

message
I am trying to reuse part of an existing custom query
on
a new database results field on a new page.
However, I
always get an error even though I think I am using
the
exact same syntax as before.

I am trying to pull only the first 175 characters
from
a
database field (called "Article"). To do it, I am
reusing this part of a custom query that already
works
on
a different page: Format Left([Article], 175)
AS "MyArticle"

The new page always generates an error in the
FrontPage
Database Properties wizard, and displays this message
when I preview a page in a browser: "Database Results
Error Description: [Microsoft][ODBC Microsoft Access
Driver] Syntax error (missing operator) in query
expression 'Format Left([Article], 175)'."

Any suggestions?


.



.


.
 
Thomas, thanks again for trying to help me figure this
out. I'm sorry to confess that I still can't make it
work. I think it's because these types of questions
press me to the edge of my limited knowledge of how HTML,
ASP, and SQL can all be used together.

In working with the line you gave me below, I know that I
need to change "fieldname" to the name of the field I
wish to modify, which is "Articles." I'm assuming that
for "recordset" I need to identify which record of my
database I should pull the fieldname from. Since that
will be different each time and identified through the
variable "ID" in my URL, I'm assuming I should use a line
FP_FieldURL(fp_rs,"ID") for recordset. Finally, since
this isn't HTML, I'm assuming I need to surround the
statement with <% %>. Given all these assumptions, it's
no wonder I can't make it work. I've tried the statement
below in different places in my code, and I have
experimented with changes to the statement. Can you
point out where I'm going wrong?
 
Ok, try:

<%=Trim(Left(FP_FieldURL("Article"),150))%>

or

<%=Trim(Left(FP_FieldURL("Article",150)))%>

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
Back
Top