http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vafctval.asp
Or various functions to convert to specific numeric types, e.g. CInt for
Integer, CDbl for Double, CCur for Currency, etc.
BTW: 'to_char'? That's Oracle, isn't it?
--
Brendan Reynolds
Access MVP
"Boots" <Bo...@discussions.microsoft.com> wrote in message
news:96B587BB-132E-4D4B...@microsoft.com...
--
Brendan Reynolds
Access MVP
"Boots" <Bo...@discussions.microsoft.com> wrote in message
news:D55747D5-7FE2-4438...@microsoft.com...
Out of interest, do you have a real life example where Val is
preferable to CDbl (or a more specific cast function)? The example in
the help
Val(" 1615 198th Street N.E.")
doesn't sound credible to me! Thanks.
BTW it should be noted that if the OP is casting data as double float
to join the two tables then the inexact nature of the type means that
an equi-join should be avoided and replaced with a BETWEEN construct
(or equivalent).
Jamie.
--
While I agree that Val(" 1615 198th Street N.E.") doesn't seem that
useful, Val("1615 Main Street N.E.") is perhaps a little more believable.
That will return 1615: CLng("1615 Main Street N.E.") will return an error.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
Sorry, I still don't get it. Why in real life would you want to cast
"1615 Main Street N.E." as a double float? There better ways of parsing
an address...?
Thanks again,
Jamie.
--
Val will also accept an empty string, returning 0 (zero) where CDbl would
raise an error. But I do not claim that this is a 'real world example' of
Val being 'preferable' to CDbl. It was never my attention to emphasise Val
over the explicit conversion functions. I originally intended to post links
to the help topics for both Val and the explicit conversion functions. I got
distracted when I discovered that the explicit conversion functions do not
appear in the Access 2003 VBA help lists of functions. Take a look at the
following two lists. The explicit conversion functions don't appear in
either of them, and some of the date functions appear under the wrong
categories in the categorised list. I've reported the error.
Functions (by category)
http://office.microsoft.com/assistance/hfws.aspx?AssetID=HP011359591033
Functions (alphabetical)
http://office.microsoft.com/assistance/hfws.aspx?AssetID=HP011353121033