Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004

    Question Unanswered: VBA quotations help


    I'm trying to assign a string (a date) to a variable which will then be appended to an SQL where statement. I hardcoded the following into the where statement and it worked:

    "<=#" & contactDateBefore & "#"

    Here is what I thought it was supposed to look like when it's assigned to a variable, but I keep getting syntax errors. (I exaggerated the spacing so it is easier to identify whether it's a double or single quote)

    strContact = " ' "<=#" ' & contactDateBefore & ' "#" ' "

    Any help would be appreciated. Thanks in advance.

    Last edited by bobbio; 06-27-04 at 01:16.

  2. #2
    Join Date
    Sep 2003
    The extremely Royal borough of Kensington, London
    Select * from tableA where column < "#" & strDate & "#"
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts