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

Putting in Access 97, a DateTime 'date' usingVB.NET

I want to put, in an Access 97 database, using the Access 'Date/Time' datatype, a 'time', using VB.NET with OleDB.

I start with the time converted to number of seconds.
eg
Expand|Select|Wrap|Line Numbers
  1. Dim long Time = 3661 '(Equivalent to 01:01:01)
This I incorporate into a query after preceding it with a '.':
Expand|Select|Wrap|Line Numbers
  1. "INSERT INTO Data_Set VALUES(.3661)"
Trouble is, it comes out in access as 10:18:47!

What am I doing wrong?
Oct 13 '14 #1

✓ answered by Rabbit

That's not how a time is stored in Access. The decimal portion of a date time value does not represent the number of seconds elapsed. It represents the percentage of the day that has elapsed. Besides, there's no reason to separate out and store only the time. Just store the full date time value and display just the time.

2 1206
Rabbit
12,516 Expert Mod 8TB
That's not how a time is stored in Access. The decimal portion of a date time value does not represent the number of seconds elapsed. It represents the percentage of the day that has elapsed. Besides, there's no reason to separate out and store only the time. Just store the full date time value and display just the time.
Oct 13 '14 #2
@Rabbit
I succeded in converting the percentage of the day to seconds so am happy - Thanks for your reply anyway. Rob
Oct 14 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Harald Hanche-Olsen | last post by:
I'm confused. I was going to try linkchecker, and it dies with a traceback ending in File "/usr/local/lib/python2.4/calendar.py", line 32, in _localized_month _months = AttributeError:...
9
by: Neil | last post by:
I have been coding with ASP for some time now. I am using an ACCESS database. I am in the UK and wish to use DD/MM/YYYY format for dates. I have had no end of problems and possible solutions to...
5
by: Annie | last post by:
hello guys, I have little experience working with C# and MS Access ... I am having an insert query with one datetime field and a boolean and couple of text and number fields as below: ...
1
by: RML | last post by:
Hi everyone, I am using VB.NET 2003 and an OleDBDataAdapter to update an Access table's DateTime field. The field's format is set to "General Date" (ie: 11/24/2004 8:00:00 AM). The problem is...
1
by: nb | last post by:
Hi I am using Ole Db to get data from MS Access into my C# windows application. In the database file, there is a column with datatype 'Datetime' and format 'Short Time'. However, in my C#...
1
by: Mike Rooney | last post by:
Hi everyone, this is my first post to this list. I am trying to create a subclass of datetime.date and pickle it, but I get errors on loading it back. I have created a VERY simple demo of this: ...
1
by: Christian Heimes | last post by:
Rick King schrieb: datetime.date is a C extension class. Subclassing of extension classes may not always work as you'd expect it. Christian
2
by: Will Rocisky | last post by:
Actually I am trying to save both date and time in one cell but they are given separately by user.
3
by: shivasusan | last post by:
Hi! I am using for my project ASP and Microsoft Access. start date and end date -- In database (Microsoft Access) i set the datatype is Date/Time. It's display error. The error is below:...
7
by: w41ter | last post by:
I'm writing a very simple python program to read in an ascii csv file with multiple records formatted like this: "2010.3.13, 0.0.0, 10.1, 12.2, 9.9, 10.1, 2500" # i.e. a list of daily stock...
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
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
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
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,...

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.