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

Timestamps

Does anyone know how to pull the date and the time from a timestamp
field in msaccess? Here is an example.

8/30/2007 11:53:00 AM

Ultimately, I would like to be able to place the date in one field and
the time in another. i would then like to be able to sort the time.
Any help would be appreciated.

Thanks,
Scott

Aug 31 '07 #1
3 11947
Date/time fields are actually serial numbers formatted to display either
date, time or both. If you're storing the values with "general" format,
just change the format (in your form/query/report) to one of the available
time formats and use that to sort on. You will probably want to sort on
date+time to accommodate values over multiple 24hr periods.
-Ed
<sc********@gmail.comwrote in message
news:11**********************@50g2000hsm.googlegro ups.com...
Does anyone know how to pull the date and the time from a timestamp
field in msaccess? Here is an example.

8/30/2007 11:53:00 AM

Ultimately, I would like to be able to place the date in one field and
the time in another. i would then like to be able to sort the time.
Any help would be appreciated.

Thanks,
Scott

Aug 31 '07 #2
sc********@gmail.com wrote:
Does anyone know how to pull the date and the time from a timestamp
field in msaccess? Here is an example.

8/30/2007 11:53:00 AM

Ultimately, I would like to be able to place the date in one field and
the time in another. i would then like to be able to sort the time.
Any help would be appreciated.

Thanks,
Scott
Here's an example. Using format, the value is a string. Cdate converts
it back to a date field.
? dt
8/31/2007 7:06:12 AM
dt = Now()
? format(dt,"mm/dd/yyyy")
08/31/2007
? format(dt,"hh:nn:ss")
07:06:55
? cdate(format(dt,"mm/dd/yyyy"))
8/31/2007
? cdate(format(dt,"hh:nn:ss"))
7:06:55 AM
Aug 31 '07 #3
sc********@gmail.com wrote:
Does anyone know how to pull the date and the time from a timestamp
field in msaccess? Here is an example.

8/30/2007 11:53:00 AM

Ultimately, I would like to be able to place the date in one field and
the time in another. i would then like to be able to sort the time.
Any help would be appreciated.
You've received some other suggestions; here is another.

You said "timestamp field" so to me that indicates the field is of type
Date.

To pull just the date portion and then just the time portion you could
use the DateValue() and TimeValue() functions. I opened the Immediate
window (Ctrl-G) and typed the text on the lines with question marks and
received the results displayed on the following line:

? datevalue(now())
9/1/2007
? timevalue(now())
11:45:55 PM

If your data field was named "StartTimeStamp" then you might do this in
a SQL query:

SELECT
DateValue([StartTimeStamp]) As StartDay
, TimeValue([StartTimeStamp]) As StartTime
FROM yourTable
.....

This query would not be updateable since StartDay and StartTime are now
*calculated* values, fwiw.

--
'--------------------------
' John Mishefske
' UtterAccess Editor
' 2007 Microsoft Access MVP
'--------------------------
Sep 2 '07 #4

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

Similar topics

7
by: lkrubner | last post by:
This might be an idiot question, but how do you group by timestamps by date? I mean, given a large number of timestamps, spanning many months, how do grab them and say how many are from each day?...
10
by: Craig Wahlmeier | last post by:
Am I the only one in the world that selects dates and timestamps with OLEDB? V8 of UDB has brought me a big problem. The PATCH2=24 setting no longer works the way it used to. The settings of...
5
by: Robert Schuldenfrei | last post by:
Dear NG, I have not heard from anyone about a good book that deals with the concurrency issue in SQL Server using C#. I have PROMISED Nick I would not use record locking and I have used an old...
2
by: Chumma Dede | last post by:
Hi, I need to code a DLL in .NET which logs the response times for our asp.net multi-tier application. The problem is we need to log the timestamps at multiple stages in a process lifecycle...
4
by: Craig G | last post by:
im not too sure how i should be storing the SQL2000 timestamps basically i return a dataset which is used to populate an editable grid. this dataset contains the timestamp. how should i be...
1
by: Erwin Van de Velde | last post by:
Hi, I'm building a central logging system for security applications as my master thesis, but I've run into some troubles: Different applications make database logs using different formats: -...
3
by: rAinDeEr | last post by:
Hi, Is there any performance issues related to having default timestamps in tables? I have a Data Model in which all the tables have created_tms and last_updated_tms which I have set default...
0
by: mikek | last post by:
Good Morning from Detroit, I am working on a project to Connect and manipulatee data in a SQLServer Data base, from a LINUX server using PERL. and SOAP We decided to use SOAP:Lite. (there are...
16
by: maruk2 | last post by:
I have some old data files with old timestamps, where timestmap=time(NULL), some of them date back to the year 1999. I want to my code to print the timestamps and each one to include...
6
by: xkenneth | last post by:
All, Just a quick question. I want to be able to have a data structure that organizes data (timestamps I'm working with) sequentially, so that i can easily retrieve the first x amount of...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.