473,395 Members | 1,631 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,395 software developers and data experts.

Splitting one field into several

Hi,

I have a field in a database called "Timestamp" which has the date and time
of an event, for example:

"01/02/2002 09:07:59"

The format is MM/DD/YYYY HH:MM:SS

I want to chop the field into six seperate fields of MM, DD, YYYY, HH, MM &
SS but cannot find a way of doing this in Access without resorting to
exporting as a text file and re-importing as a fixed width file.

Can anyone help?

Many thanks

L
Nov 13 '05 #1
3 1569
What are you going to do with them seperated?

Create the extra fields first. Then make an update query and use the
format function or there are month, day, year, second, minute, hour
functions. Check access help.

Nov 13 '05 #2
You could create a query to get the pieces you want... what do you need
to do with the data that requires this?
check out DatePart, Month(), Year(), Hour(),Minute()... etc.
you could do all this in a query at runtime, if you wanted...

La di da Limey wrote:
Hi,

I have a field in a database called "Timestamp" which has the date and time of an event, for example:

"01/02/2002 09:07:59"

The format is MM/DD/YYYY HH:MM:SS

I want to chop the field into six seperate fields of MM, DD, YYYY, HH, MM & SS but cannot find a way of doing this in Access without resorting to
exporting as a text file and re-importing as a fixed width file.

Can anyone help?

Many thanks

L


Nov 13 '05 #3
On Wed, 09 Mar 2005 16:47:29 GMT, La di da Limey wrote:
Hi,

I have a field in a database called "Timestamp" which has the date and time
of an event, for example:

"01/02/2002 09:07:59"

The format is MM/DD/YYYY HH:MM:SS

I want to chop the field into six seperate fields of MM, DD, YYYY, HH, MM &
SS but cannot find a way of doing this in Access without resorting to
exporting as a text file and re-importing as a fixed width file.

Can anyone help?

Many thanks

L


Why bother?

Access stores date/time as a double number, counting the number of
days from 12/30/1899, and time as the percentage of a 24 hour day from
midnight.
So 3/9/2005 09:02:00 AM is stored as 38420.3766898148.

How the date is formatted is not relevant as long as it is a date
datatype field.

If the date field already contains the full date and time, all you
need do, whenever you wish to show those separate values, is use:
=Year([DateField]) (year)
=DatePart("m",[DateField]) (month)
=Month([DateField]) (month)
=DatePart("d",[DateField]) (Date day)
= DatePart("h',[dateField]) (hour)
=DatePart("n",[dateField]) (minute)
etc.
Look up DatePartI(), Month(), Year(), WeekDay(), etc. for additional
arguments to return the parts of a date datatype field.

Or you can simply format the date field to show the part you want:
=Format(DateField],"mmm") will display March.

Hope this helps.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #4

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

Similar topics

10
by: Angelo Secchi | last post by:
Hi, I have string of numbers and words like ',,,,,,23,,,asd,,,,,"name,surname",,,,,,,\n' and I would like to split (I'm using string.split()) it using comma as separator but I do not want to...
26
by: Kai Jaensch | last post by:
Hello, i am an newbie and i have to to solve this problem as fast as i can. But at this time i donīt have a lot of success. Can anybody help me (and understand my english :-))? I have a...
3
by: Rakesh | last post by:
Hi, I was 'googling' to look out for some ways of optimizing the code and came across this term - 'hot / cold splitting'. In short, the discussion is about splitting heavily accessed ( hot )...
4
by: guitarromantic | last post by:
Hey everyone. Following advice found online, I figured out a basic way of splitting a long article into several pages, by exploding out from a <!--pagebreak--> code in my $content field. ...
2
by: Gary Lynch | last post by:
I am looking for a simple solution to a recurrent problem with imported data in Access 97. The example below is a simplification of a problem with a much larger database. Let's say I start out...
5
by: Peter Oliphant | last post by:
I was thinking it might be a good idea to split this newsgroup into different newsgroups, depending on the version of VS C++.NET being discussed. Thus, there would be 2002, 2003, and 2005...
3
by: aaronvb | last post by:
Hi there, I'm currently trying to fix up a database that has had many different people work on it and therefore is confusing me no end. Currently i am trying to update a field, in the table ...
4
by: Steven D'Aprano | last post by:
I'm trying to split a URL into components. For example: URL = 'http://steve:secret@www.domain.com.au:82/dir" + \ 'ectory/file.html;params?query#fragment' (joining the strings above with plus...
37
by: xyz | last post by:
I have a string 16:23:18.659343 131.188.37.230.22 131.188.37.59.1398 tcp 168 for example lets say for the above string 16:23:18.659343 -- time 131.188.37.230 -- srcaddress 22 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.