Eliminate "forward slash" in a field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table which contains a date of birth. The field was originally set
up as a date/time field and formated as a long date. I now need to convert
this field to a text or number field and I need to eliminate the "/" that
appears between the month, day and year.

Is this possible?
 
Do you need to modify the data in your table, or do you need to display
what's there in a different way? You could keep your existing data and use
a query to Format() that field, changing how it appears in forms, reports,
etc.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Why?

Create a query and put a computed field in it.

To convert to text, you can use

Format([DOB], "mmddyyyy")

(or whatever format you want)

To convert to a number, you can use

CLng(Format([DOB], "mmddyyyy"))

You'd then use the query wherever you would otherwise have used the table.
 
Hi

I Think you may be making a mistake with this, but you know your database
and I don't so if you simply want to remove the / then go to the table in
design view and select the field with the time/date info. Set the format as
ddmmyyyy or (in the US) mmddyyyy -

To convert the data to text you could use a query - I would NOT do this
though ?? Better to use a calculated field and keep both
TextDate:'"' & Format$([FieldName],"ddmmyyyy") & '"'
or
TextDate:'"' & Format$([FieldName],"mmddyyyy") & '"'

to get the number (or are you looking for the serial number ?) - the integer
use
Val - format - etc


Good luck
 
In a Query, try:
NewDate:Format([DateField],"mmddyy")

You can use this field in an Update query to alter the data in your table.
Make sure the field you are updating is a text field. It is also a good idea
to not overwrite the field you are trying to convert unless you have a good
copy you can get back to.

Depending on how your data is saved (if it is not truly a date field), you
can also use the Replace function.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top