Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2004, 05:52 PM
Authorized User
 
Join Date: Jun 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default Date issue, using BETWEEN

Hi Everyone,

I am having a problem with a BETWEEN statement using dates.

Im testing my app on MS Access and it works fine, but when im reading off SQL 2000 it fails the error received is

Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '#'.

Does SQL 2000 require different syntax?

You advice would be much appreciated.

Tim :)

** SQL Statement ***

Code:
strSQL = "SELECT Opp.OppID, Opp.OppRef, Opp.OppName, Opp.OppDescShort, Opp.OppPublished, Opp.OppClosing " & _
                     "FROM GamesLink_Opportunities " & _
                     "AS Opp WHERE (Opp.OppPublished BETWEEN #"&DateFrom&"# AND #"&DateTo&"#) ORDER BY Opp.OppName"
TDA
__________________
TDA
 
Old June 8th, 2004, 06:07 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I think you should replace the '#' with single quotes (').

Let me know if it works.

Snib

<><
 
Old June 8th, 2004, 08:01 PM
Authorized User
 
Join Date: Jun 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default

Yes that worked.

I swear i tried that and it didn't work but i did!

I feel so stupid!

Thanks

Tim

TDA





Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Related Issue Kirti.darji Visual Studio 2005 0 May 13th, 2008 06:40 AM
Date Issue tna55 ASP.NET 2.0 Basics 4 September 5th, 2007 04:08 AM
Date conversion Issue dhay1999 Access 2 May 30th, 2007 06:47 AM
Date issue... Grafixx01 Access 16 April 24th, 2007 11:28 AM
Date function issue Grafixx01 Access 2 April 11th, 2007 02:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.