+ Reply to Thread
Results 1 to 3 of 3

Help with the code to pass a variable into the command syntax

  1. #1
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Help with the code to pass a variable into the command syntax

    Hi All

    I was wondering whether someone can help me with the following query.

    I have a code where it sets a connection to SQL server and runs a predefined procedure.

    What I need is user enters a date which I have assigned variable YearVal to it and depending on the value of the date it will add it to the end of my procedure
    Please Login or Register  to view this content.
    In the code above what I want is instead of 2015 I put YearVal so user can choose which year's data they want to display.

    I'm not sure how to do this. Can someone please let me know the correct syntax to do this.

    Tank in advance

  2. #2
    Registered User
    Join Date
    07-18-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    36

    Re: Help with the code to pass a variable into the command syntax

    try
    Please Login or Register  to view this content.
    Please click the 'Add Reputation' star in lower left if I have helped you.

  3. #3
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Help with the code to pass a variable into the command syntax

    This worked perfectly. Thank you for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 05-15-2015, 07:27 PM
  2. Pass by a command if worksheet doesnt exist
    By Frankie_The_Flyer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2015, 08:19 AM
  3. pass multiple items to a command line
    By marcwords in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2013, 03:30 PM
  4. [SOLVED] Pass Variable in VB Code
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-05-2013, 04:49 AM
  5. Syntax for Range command with a variable
    By nebb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2007, 12:14 PM
  6. [SOLVED] How to: Pass Command Line Parameter ???
    By Webtest in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-24-2005, 01:05 PM
  7. Pass path result from FilePicker to vlookup with correct syntax
    By sabs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2005, 06:44 PM

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