Results 1 to 2 of 2
  1. #1
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    313

    Using pound sign as date delimiter


    When I use ADODB in VBA to query an Access table for a date, I use syntax such as SELECT * FROM CUST WHERE CREATE_DATE > #01/01/2010#... This works fine when I'm querying an Access Database. However, when I try to use this syntax to query a table on SQL Server 2008 R2, it returns a syntax error. When I remove the pound signs, it works fine. The problem is that I need the same code to run against either database. Is there a setting on SQL Server that I can set to make is accept the pound sign delimiter convention? Thanks, Eddie

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    Never used SQL Server but I doubt it. Probably need to have code that will structure the SQL statement to use appropriate syntax conditional on the target table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 35
    Last Post: 09-19-2011, 10:13 AM
  2. Replies: 0
    Last Post: 03-08-2011, 11:07 AM
  3. Replies: 0
    Last Post: 10-06-2010, 11:56 AM
  4. Pound sign in text field
    By eww in forum Programming
    Replies: 3
    Last Post: 09-29-2010, 10:30 AM
  5. Replies: 3
    Last Post: 01-15-2010, 02:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums