Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-18-2023, 09:49 AM
gmaxey gmaxey is offline ADODB connection string to retrieve actual values Windows 10 ADODB connection string to retrieve actual values Office 2019
Expert
ADODB connection string to retrieve actual values
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default ADODB connection string to retrieve actual values

I have an Excel file that contains columns with mixed data formats (i.e., the first row heading is text, the remaining values are percentage, the first row heading is text the remaining rows are currency etc.




I am trying to retrieve these values as their actual displayed percentage, currency values via an ADODB connection:



strConn = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & dbPath & ";" & _
"Extended Properties=""Excel 12.0 Xml;HDR=YES;IMEX=1"";"



But it isn't working. I am getting their text equivalents e.g, $12.00 is returned as 12
5.00% is returned as .05


Is there a way to get the actual values from the Excel record fields? Thanks


Cross posted at: ADODB Get actual displayed values
Attached Images
File Type: png Sample Data.png (19.7 KB, 13 views)
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #2  
Old 11-18-2023, 12:17 PM
June7's Avatar
June7 June7 is offline ADODB connection string to retrieve actual values Windows 10 ADODB connection string to retrieve actual values Office 2010
Novice
 
Join Date: Nov 2023
Posts: 20
June7 is on a distinguished road
Default

You are getting numbers which are the actual values. If you want exactly what is displayed (which is produced by cell formatting), that would be text. Why? Use linked table in a query or report and do formatting there.
Reply With Quote
  #3  
Old 11-18-2023, 01:34 PM
gmaxey gmaxey is offline ADODB connection string to retrieve actual values Windows 10 ADODB connection string to retrieve actual values Office 2019
Expert
ADODB connection string to retrieve actual values
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Why? I thought that would be obvious. I want percentage and currency values in the data source and when I extract that data to use in a Word form, I want the percentage value and currency value (not simply the numbers). Yes, I have used an Access query in the manner you have described, but I am not familiar with Excel queries or how to format them so that their displayed value (not the underlying number) is extracted. I have some homework to do. Thank you.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #4  
Old 11-18-2023, 07:37 PM
June7's Avatar
June7 June7 is offline ADODB connection string to retrieve actual values Windows 10 ADODB connection string to retrieve actual values Office 2010
Novice
 
Join Date: Nov 2023
Posts: 20
June7 is on a distinguished road
Default

Cross-post ADODB Get actual displayed values
Reply With Quote
  #5  
Old 11-18-2023, 10:01 PM
gmaxey gmaxey is offline ADODB connection string to retrieve actual values Windows 10 ADODB connection string to retrieve actual values Office 2019
Expert
ADODB connection string to retrieve actual values
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

This issue is resolved see:
[SOLVED] ADODB Get actual displayed values


The solution is a workaround using and Excel Power Query
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #6  
Old 11-20-2023, 08:21 PM
zpy2 zpy2 is offline ADODB connection string to retrieve actual values Windows 10 ADODB connection string to retrieve actual values Office 2013
Novice
 
Join Date: Sep 2023
Location: China
Posts: 28
zpy2 is on a distinguished road
Default

select format(0.05,"0.00%");
select format(12,"$0.00");
Reply With Quote
  #7  
Old 11-21-2023, 06:34 AM
gmaxey gmaxey is offline ADODB connection string to retrieve actual values Windows 10 ADODB connection string to retrieve actual values Office 2019
Expert
ADODB connection string to retrieve actual values
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

I am not sure what question your reply is supposed to be trying to answer.


I could have one or a thousand records with percentages or currency values. All will not be 0.05. What am I supposed to select how would selecting one item resolve all 1 or 1000?


I think the answer to the question asked is that column formatting applied by Excel or Access determines what is displayed in the columns but does not alter the underlying value. ADODB get the underlying value so there is no way to get the displayed value unless the displayed value is the underlying value. We have done that using the queries.



Thank you just the same.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retrieve or redo aol mail password without affecting Outlook connection? glnz Outlook 0 02-20-2022 12:57 PM
ADODB connection string to retrieve actual values Retrieve characters after nth occurence of a string veedee Excel 5 06-16-2014 03:41 PM
ADODB connection string to retrieve actual values Retrieve Values from Content Controls for hidden john s. Word VBA 1 02-21-2014 02:14 PM
ADODB.Connection.Open Provider? tinfanide Excel Programming 0 11-14-2012 04:25 AM
Changing resources against tasks with actual values joday48 Project 3 06-28-2012 05:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft