Re: Number Data Type Field and Leading Zeros

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Ken Snell (kthsneisllis9_at_ncoomcastt.renaetl)
Date: 07/27/04


Date: Tue, 27 Jul 2004 19:22:45 -0400

Can't be done with a number formatted field. You will have to change the
field to text format.

Text can easily be converted to numbers via Val function and other means.
Your other programs will need to do the conversion.

-- 
        Ken Snell
<MS ACCESS MVP>
"Carlos" <anonymous@discussions.microsoft.com> wrote in message
news:542d01c47429$8d83c200$a601280a@phx.gbl...
> I have a table that has one field set to a number data
> type. As part of the values input process, I need to enter
> values leading with a zero as the first digit.
> Unfortunately, every time we try to enter one of these
> values, Access drops the leading zero automatically. Also,
> I can't change the data type to text since programming
> code in other applications tied in to this table require
> the field to be a number data type.
>
> Any suggestions on how to keep the leading zero as part of
> the values without having to change the data type?
>
> Thank you.


Relevant Pages

  • Re: What does Val return?
    ... that the data type of the returned value will automatically converted ... Dim myString as String ... so I suspect that the initial return of the Val function ... I'm not sure it's worth writing an explicit CLng conversion. ...
    (microsoft.public.word.vba.general)
  • Re: Where are the CONVERT & CAST functions in MDB?
    ... but I cannot the SQL type-conversion functions that works in SQL Server ... Each function coerces an expression to a specific data type. ... CVar Variant Same range as Double for numerics. ... you can document your code using the data-type conversion ...
    (microsoft.public.access.modulesdaovba)
  • Re: Where are the CONVERT & CAST functions in MDB?
    ... I thought those functions were only for VBA code, not SQL. ... Each function coerces an expression to a specific data type. ... CVar Variant Same range as Double for numerics. ... you can document your code using the data-type conversion ...
    (microsoft.public.access.modulesdaovba)
  • Re: Divide by Zero when it should not.
    ... values to Double data type. ... to change the data types within the query. ... I have a query that return a "Division by Zero" error ... I get the division by zero error then the query stay in design mode, ...
    (microsoft.public.access.queries)
  • Re: How to find the datatype of a variable?
    ... "upgrades" it to a long or a double. ... I'm aware of the type conversion issue you mentioned, ... Besides the Variant-explict data type examples the Mike provided (which I ... that trailing ampersand to force the numeric to be a Long is ...
    (microsoft.public.vb.general.discussion)