• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Query Causes ASP Error

New Here ,
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

This query works great within MS Access itself but causes and error when used in an ASP application ...
DateAdd("m",-2,EndDate()) >= Date()

Someone suggested there is a problem with the quote marks in ASP. Would appreciate any help to resolve this. The original thread is below. Thanks.

Newsgroup User has posted a message entitled Re: EndDate.

Message Posted on: Monday January 22,2007 05:01:27 PM
You use a DateAdd function to get this, something like

DateAdd("m",-2,EndDate()) >= Date()

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Tiggerick" <webforumsuser@macromedia.com> wrote in message
news:ep2nej$oar$1@forums.macromedia.com...
> Our current function is ... EndDate() >= Date() ... which is used to
> screen out
> any results prior to today's date.
> We would like to modify this so that instead of today's date we would use
> the
> date 2 months prior to today's date, so that, for example the EndDate() on
> 1/22/07 would be 11/22/06.
> Would appreciate help on the format for this.
> Thanks in advance!
> Rick
>




You can view the message at http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=189&threadid=1235135&forumid=12.

Text quote marks Text
TOPICS
Server side applications

Views

325

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

Here is the complete SQL statement that is causing a problem. Dreamweaver is showing the m inside the quotes in black if that means anything ...

Recordset1.Source = "SELECT * FROM Events WHERE EventType = '" + Replace(Recordset1__MMColParam, "'", "''") + "' AND EndDate >= DateAdd("m", -2, Date()) ORDER BY StartDate ASC"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

LATEST
The quotes around m are the problem here. Double them up to send as-is to
Access (""m"" instead of "m").

"Tiggerick" <webforumsuser@macromedia.com> wrote in message
news:er00oi$duu$1@forums.macromedia.com...
> Here is the complete SQL statement that is causing a problem. Dreamweaver
> is
> showing the m inside the quotes in black if that means anything ...
>
> Recordset1.Source = "SELECT * FROM Events WHERE EventType = '" +
> Replace(Recordset1__MMColParam, "'", "''") + "' AND EndDate >=
> DateAdd("m", -2,
> Date()) ORDER BY StartDate ASC"
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines