Time field saving Date value in Ms Access

Umashankar.vis

New member
Joined
Mar 27, 2008
Messages
3
Programming Experience
Beginner
Hi,

I am new to VB .net :confused:. I have a access database called "Detail" with following field in it.

ID - Autonumber
EmpID - Number
Date - Date/Time
Name - Text
Exam no - Number
Start time - Date/Time
End time - Date/Time
Comments - Text

I have connected this database to my form in VB .net by using data connection option in server explorer. It was connected and can able to view the records. But when I try to add records to this database I have a problem. I entered Time value in "Start time" and "End time" text field. but in my database it was saved as a date value. (For example I entered "22:10" and "23:05" in the respective fields. but in my database it stored as a current date"03/27/08").

Could you please help me in this. :(
 
In Access what are the format properties for the Date/Time fields?

Is it showing up as "03/27/08 00:00" or "03/27/08"?
 
Time field saving date field

Hi,

The "start time" and "End time" field format is short time in MS Access. But the record was saved in database as "12:00:00 AM" in "Start time" and End Time" when I click the data it shows me "3/27/2008".

Uma Shankar
 
caling a database column "date" (or naming any column the same name as a datatype) is a bad idea. putting spaces in the names is also a bad idea.

you seem to have a disconenct in your understanding of dates and times. datetime contains a date and a time

start time includes the date, end time includes the date. you cannot get away from this. dates are represented as the number of days since a certain point in time. so a date of 1.5 is one and a half days after e.g. 01 jan 1970.. ie. it is noon on 02 jan 1970

you cannot remove the date portion from a date time any more than you can remove the 12 part of 12.34.. You can subtract 12 and get 0.34, but you still have a major component to the number.. i.e. you still have something to the left of the decimal point

dump the idea that youre donna have a "date" and two separate "time" fields.. just make a start datetime and an end datetime
 

Latest posts

Back
Top