+ Reply to Thread
Results 1 to 1 of 1

How to substitute dates using cell reference in SQL query using VBA

  1. #1
    Registered User
    Join Date
    07-01-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2000
    Posts
    1

    Question How to substitute dates using cell reference in SQL query using VBA

    Hi,


    I am trying to use VBA to perform a query on our SQL2005 server but I would like to use dates entered in cells B1 and B2 to replace the START_DATE in the query instead of hard coding the dates. The START_DATE field is formatted as datetime and our system uses the dd/mm/yyyy hh:mm:ss format. When I run the code below, it is working fine but I am not sure how I can replace the START_DATE (e.g. entered as 01/01/2012 dd/mm/yyyy) with cell references. Any help would be much appreciated. Thanks.

    Please Login or Register  to view this content.

    Moderator's Note: Put code tags on your codes. Thanks.
    Last edited by vlady; 10-29-2012 at 01:17 AM. Reason: Code tags.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1