LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default formatting results from mysql query

I have a function that grabs a number from a mysql database. To return the
number, I use:

GetMySql = myrs.Fields(lString).Value

and the result in the spreadsheet is returned as, for example, 3980 and is
left justified as if it were a string.

If I try

GetMySql = Format(myrs.Fields(lString).Value, "#,##0")

the result is 3,980 and is still left justified.

then i tried

GetMySql = CCur(myrs.Fields(lString).Value)

and now it's right justified, but it shows as 3980.

So how can I get the number returned as a number type format with a comma
and make it right justified?

Seems simple, but I'm beating my head against the keyboard.

TIA
Mike


--
Michael J. Malinsky



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
No Results returned from Access query Chuck W[_2_] Excel Discussion (Misc queries) 3 September 23rd 09 03:37 PM
Access query results to Excel piano banger Excel Discussion (Misc queries) 4 December 8th 06 09:32 AM
Formatting datetime problems importing data from mysql db PEA Excel Discussion (Misc queries) 2 February 23rd 06 11:04 PM
Web Query Sleep for until results come Sunil_Modi Excel Worksheet Functions 0 November 19th 04 04:29 PM
Replace ActiveCell w/Query Results? pkillebrew Excel Programming 1 November 5th 03 11:03 PM


All times are GMT +1. The time now is 07:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"