Re: Using Left Function in table design.



On 25 Jan 2006 01:58:32 -0800, "Jason" <wills.jason@xxxxxxxxx> wrote:

>I am trying to create a simple database, but it's proving too complex
>for me!!!
>I have only just started a new database and am trying to have two
>fields in a table:
>the first holding the first name of a person (FirstName) and the second
>to be the first charactrer of that name.
>
>i am using the default value property for the second field of
>"=Left([FirstName],1)", but i am getting error messages when tryign to
>save it.
>
>does anyone know what i am doing wrong, i would like it so that the
>first could be entered as "Jason" and the second field would
>automatically enter "J".
>
>can anyone helps, thanks
>
>Jason

You can't set a calculated default value like this in a table.
However from your description, there is no need to have the 2nd field in the table to store the first letter of the
first name. This value can be calculated whenever needed using the same formula you are attempting to set with the
default value.

=Left([FirstName],1)

In any form or report where you need to display the first letter, use this formula as the controlsource of a textbox.

Basic rule of database design - you *normally* do not store in a table that which can be calculated from existing data.



Wayne Gillespie
Gosford NSW Australia
.



Relevant Pages

  • Re: Fill Factor
    ... I have a table with two fields, ID as Int, Doc as Image datatype, ... the second field is used to store images of type "tiff". ... Andrew J. Kelly SQL MVP ... database, i deployed a database to a client and sit the Fill Factor for ...
    (microsoft.public.sqlserver.setup)
  • Re: Fill Factor
    ... I have a table with two fields, ID as Int, Doc as Image datatype, ... the second field is used to store images of type "tiff". ... Andrew J. Kelly SQL MVP ... database, i deployed a database to a client and sit the Fill Factor for ...
    (microsoft.public.sqlserver.setup)
  • VB 6 OraOLEDB problem with database record retrieval
    ... Two fields are being queried for and placed in a recordset. ... (question marks). ... the database, the second field does have values. ...
    (microsoft.public.win32.programmer.ole)
  • Using Left Function in table design.
    ... I am trying to create a simple database, but it's proving too complex ... first could be entered as "Jason" and the second field would ...
    (comp.databases.ms-access)
  • Re: public and private mailboxes randomly dismounting
    ... When posting logs an important piece is the Event ID and Source. ... Information Store First Storage Group: An attempt to move the file ... An error occurred while writing to the database log file of storage group ...
    (microsoft.public.windows.server.sbs)