473,406 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Converting dates

I need help converting dates. Currently, I have several tables and
databases that use the format 1/20/2007. I have a table right now
that uses the 20070120 format, and I was hoping that someone could
help me convert this. Thanks!

May 3 '07 #1
3 2793
GH
Are you trying to change how that table stores the date or do you need
the date reformatted for display purposes? You can always create a
date string using the MID, RIGHT, and LEFT functions, such as DateFmt:
DateValue(Mid([Date],5,2) & "/" & Right([Date],2) & "/" & Left([Date],
4)). If you want the table store changed, you can always add a new
field with the formatted date and perform an update query that
converts the date using the above function. I am not sure if this is
what you are looking for, so please post again if you need specific
behavior.

- GH

On May 3, 10:27 am, zsh...@riteaid.com wrote:
I need help converting dates. Currently, I have several tables and
databases that use the format 1/20/2007. I have a table right now
that uses the 20070120 format, and I was hoping that someone could
help me convert this. Thanks!

May 3 '07 #2
So you have a Number (or Text?) field that contains values such as:
20070120
for 2007, Jan, 20.

Create a query.
Type an expression like this into the Field row:
CVDate(Format([Field1], "0000\/00\/00"))
replacing Field1 with the name of this field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<zs****@riteaid.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
>I need help converting dates. Currently, I have several tables and
databases that use the format 1/20/2007. I have a table right now
that uses the 20070120 format, and I was hoping that someone could
help me convert this. Thanks!
May 3 '07 #3
zs****@riteaid.com wrote:
I need help converting dates. Currently, I have several tables and
databases that use the format 1/20/2007. I have a table right now
that uses the 20070120 format, and I was hoping that someone could
help me convert this. Thanks!
Look at the field properties and look to see if they are actual dates
and just change the field properties. Date fields can be stored the
same and the field properties is what makes them look different. This
may not really be feasible if you already have other reports that need
the date in a different form.

You should be able to do a query and just make a computed column using a
function or something to reformat the date.

http://office.microsoft.com/en-us/ac...CH062526711033
May 4 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Kit | last post by:
Howdy! I have some dates in a MySQL database that are in a 'Y-m-d' format. Is there a way to have PHP read these dates and convert them to a 'd-M-Y' format?
0
by: Massimo Fiorentino | last post by:
Hello there! I am a bit of a newbee into the mySQL world and I have a question regarding switching from one DB to another. I have for a couple of years used a very simple CMS-system created by...
6
by: Jim Davis | last post by:
Before I reinvent the wheel I thought I'd ask: anybody got a code snippet that will convert the common ISO8601 date formats to a JS date? By "common" I mean at the least ones described in this...
3
by: Scott Kinney | last post by:
I have a database that I imported from a csv file (I know, all the stories start out this way...) The dates were given as text strings of the form 'yyyymmdd', and were imported as text. Not all...
7
by: Dana Shields | last post by:
I am attempting to upsize from access to SQL Server. I'm trying to convert my queries to SQL Server views; however, I'm having a lot of difficulty with the syntax differences. For instance, a...
12
by: Vincent Delporte | last post by:
Hello My site is hosted on a server in the US, hence set up to use the mm/dd/yyyy date format instead of the European dd/mm/yyyy. Also, MySQL stores dates as yyyy-mm-dd, so I need to convert...
21
by: py_genetic | last post by:
Hello, I'm importing large text files of data using csv. I would like to add some more auto sensing abilities. I'm considing sampling the data file and doing some fuzzy logic scoring on the...
5
by: wespw1 | last post by:
I have a form where I have 2 dates: 06/27/2007 01/28/1996 What I need to get is the difference between the 2 dates in months. Or in otherwords I am trying to get the age of the 2 dates in...
11
by: Keith Hughitt | last post by:
Hi, I am having a little trouble figuring out how to convert a python datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would like to create a UTC date so that when I send it to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.