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

Date/Time Data Type

Tom
In a JET db using ACCESS, I specify a field Data Type as Date/Time and the
Format as Short Date. These dates appear as 1/3/2003, 3/31/2003 ..... in
Access which is fine since I don't want the time. Yet in a VB.NET program,
where I display the same data from the JET db in a textbox, they appear as
1/3/2003 12:00:00 AM, 3/31/2003 12:00:00 AM ...... How do I get rid of the
time, 12:00:00 AM? I'm using Access 2003 and VB.NET 2002.
--
Tom
Nov 21 '05 #1
3 5923
"Tom" <To*@discussions.microsoft.com> schrieb:
In a JET db using ACCESS, I specify a field Data Type as Date/Time and the
Format as Short Date. These dates appear as 1/3/2003, 3/31/2003 ..... in
Access which is fine since I don't want the time. Yet in a VB.NET program,
where I display the same data from the JET db in a textbox, they appear as
1/3/2003 12:00:00 AM, 3/31/2003 12:00:00 AM ...... How do I get rid of the
time, 12:00:00 AM?


Please post the code you are currently using to display the date in the
textbox.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
"Chrisg" <Ch****@discussions.microsoft.com> schrieb:
When I just need the date I just format it with the desire format type.

myString = myDate.ToString("d")


..NET Framework Developer's Guide -- Date and Time Format Strings
<URL:http://msdn.microsoft.com/library/en-us/cpguide/html/cpconDateTimeFormatStrings.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
Tom
That's a good question, to post the code used to display the date in the
textbox. I used the Data Form Wizard to display the data from a table in the
database.

"Chrisg" wrote:
When I just need the date I just format it with the desire format type.

myString = myDate.ToString("d")

The result is just the format that you are looking for, but it is now a
string.

"Herfried K. Wagner [MVP]" wrote:
"Tom" <To*@discussions.microsoft.com> schrieb:
In a JET db using ACCESS, I specify a field Data Type as Date/Time and the
Format as Short Date. These dates appear as 1/3/2003, 3/31/2003 ..... in
Access which is fine since I don't want the time. Yet in a VB.NET program,
where I display the same data from the JET db in a textbox, they appear as
1/3/2003 12:00:00 AM, 3/31/2003 12:00:00 AM ...... How do I get rid of the
time, 12:00:00 AM?


Please post the code you are currently using to display the date in the
textbox.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4

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

Similar topics

1
by: Dave Posh | last post by:
I seem to be having a problem displaying time stored in mysql. The format stored in the database is 13:15:05. The database data type is time. I'm using asp vbscript and sql to retrieve the time...
2
by: David Slinn | last post by:
I have created a simple XML document, generated a schema from it (which Visual Studio makes everything a string element). I then went through and changed all fields that are dates to the Date data...
5
by: nick_faye | last post by:
hi, how can i set the dates in a fieldn in my tables in ms access to handle only dates and no time? in creating my table, i set its type to 'date/time' with 'short date' format. but when i...
1
by: MLH | last post by:
In an Access 97 form, I have a textbox control with the following code that runs AfterUpdate... Option Compare Database Option Explicit Private Sub UNIXdate_AfterUpdate() Me!RealDate =...
11
by: Dixie | last post by:
How can I programatically, take some Date/Time fields present in a table in the current database and change their type to text? dixie
2
by: x | last post by:
hi i am a pilot by profession. i want to create a database of my logbook using ms access 2002. i am facing a problem regarding the format of time field. when i select "Data/Time" data type for my...
5
by: Ray | last post by:
I have a table with some audit date and time columns. Problem is the developer who stored the data left them as DECIMAL type instead of DATE and TIME. Is there a way I can convert the DECIMAL type...
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
11
by: Connie via AccessMonster.com | last post by:
Hi Access Building Friends, I am building a database for a manufacturer who needs to know the projected End_Date of each job. I know the Start_Date and the total days required to do the job. ...
13
by: chromis | last post by:
Hi, I have a query which updates the projects table of my database, however when I try to run my query with blank values i get the following error: Data truncation: Data truncated for column...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.