+ Reply to Thread
Results 1 to 2 of 2

Need to find lengths and place in sql query.

  1. #1
    Forum Contributor
    Join Date
    08-15-2016
    Location
    Chennai
    MS-Off Ver
    MS2013
    Posts
    159

    Need to find lengths and place in sql query.

    Hi,

    I have connected DB2 successfully thru macro and taking the value from sheet1 and keeping the same in query.

    Now the issue is sometimes the value is less than 9 digits. so i couldnt able to run that query.

    My query required 9 digits to run successfully. how can we do this? (I cant change the values in Sheet1)

    Ex: Sheet1 value = 123456
    SQL query should updated as = 000123456


    Sheet1:
    ssn = x.Sheets("Sheet1").Range("B" & i).Value

    Query used:
    Sql = "select sso.FUNC_DECRYPT_STR(ALPHA_PASSWORD) from SSO.SSO_USER where sso_user_id =" & ssn
    rs.Open Sql, conn

    Please help me to solve this.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,057

    Re: Need to find lengths and place in sql query.

    Try:
    Please Login or Register  to view this content.
    or:
    Please Login or Register  to view this content.
    Last edited by Arkadi; 06-09-2017 at 09:28 AM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

+ 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: 13
    Last Post: 08-21-2015, 02:27 PM
  2. Macro to query column for date if found place text in cell
    By 2k05gt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2014, 06:06 PM
  3. [SOLVED] Find average of different wave lengths
    By rovaniemi in forum Excel General
    Replies: 6
    Last Post: 08-14-2013, 06:34 AM
  4. [SOLVED] Formula to find a match with different string lengths
    By mcranda in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-09-2013, 04:34 PM
  5. [SOLVED] Modifying a Lat/Long function to extract ID and Reference from a Google Place query
    By Eagle29 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2013, 05:51 AM
  6. [SOLVED] Find possible combinations that fall between two lengths
    By Tulipo in forum Excel General
    Replies: 0
    Last Post: 04-23-2012, 08:47 AM
  7. Range.Find to find column and place value in next available cell in one line
    By davegugg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2011, 10:41 AM

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