+ Reply to Thread
Results 1 to 3 of 3

Ado Query with specified Decimal Places

  1. #1
    Registered User
    Join Date
    11-23-2012
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    9

    Ado Query with specified Decimal Places

    I am querying a excel file USING A EXCEL Macro. I populate an ADO recordset with a SELECT statement ,so how can I limit the number of decimal of the data retrieved from excel file, for instance:

    excel data
    --------
    12.3654
    11.369
    25.125
    14.7521
    retrieved data
    ------------
    12.37
    11.37
    25.13
    14.75

    "SELECT buy FROM employes WHERE id=12".

    Is there some way to do it directly in the command line "SELECT" ..?

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519
    Just format the column after you import.
    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    11-23-2012
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Ado Query with specified Decimal Places

    MIKE, thanks for your answer, .........how can I retrieve data only with 2 decimal if I have the following command:

    For col = 1 To nc / 2 ' nc colums number

    oF = 2 * col - 1 ' only odd columns
    rs.Open "SELECT MIN((F" & Trim(Str(oF)) & ")^2+(F" & Trim(Str(oF + 1)) & ")^2) FROM [compilation$B6:CU32450]", con

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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