Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 19th, 2003, 10:56 AM
Registered User
 
Join Date: Oct 2003
Location: DC, DC, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default insert system date. no date and time

Hi friends,

I try to update a table with system date. it does not work. no system date and time.
my query as
***UPDATE ADJFLAT SET ADJFLAT.ImportDate = Format(Date(),'mm/dd/yyyy')
however, i am still got system format of date and time
as 11/18/2003 0:00:00.

But i am only need to 11/18/2003 as output results


Thnaks!!!



Jimmy

 
Old November 19th, 2003, 11:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

That's because the field is a DateTime type - there's no such thing as a Date only field in Access. If you don't put in a time you get the default of midnight. Just ignore the time part when you display the field.
 
Old November 19th, 2003, 12:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oxford, , United Kingdom.
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jimmy

This has just been covered here: http://p2p.wrox.com/topic.asp?TOPIC_ID=6587


Brian Skelton
Braxis Computer Services Ltd.
 
Old November 19th, 2003, 02:22 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now, for my life, I can not recall how to get the time out of the datetime
When I do

Time: Format([dateone],"hh:nn ss")

only re turns
20:45
in military time. How do I get it to do the standart 8:45 PM
My brain is fried.




Sal
 
Old November 19th, 2003, 04:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oxford, , United Kingdom.
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try:
Code:
Format([dateone],"hh:mm AM/PM")

Brian Skelton
Braxis Computer Services Ltd.
 
Old November 19th, 2003, 05:20 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will be able to sleep tonight.

Thanks Brian.




Sal
 
Old November 20th, 2003, 01:11 PM
Registered User
 
Join Date: Nov 2003
Location: Hyderabad, AP, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you just give Date(), it should return just date. I am doing that already.

Quote:
quote:Originally posted by jimmy
 Hi friends,

I try to update a table with system date. it does not work. no system date and time.
my query as
***UPDATE ADJFLAT SET ADJFLAT.ImportDate = Format(Date(),'mm/dd/yyyy')
however, i am still got system format of date and time
as 11/18/2003 0:00:00.

But i am only need to 11/18/2003 as output results


Thnaks!!!



Jimmy





Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I set system time & date in VB.net ? mike123abc Pro VB.NET 2002/2003 1 April 27th, 2007 10:00 AM
Insert System date and System Time -Form _TextBox cnkumar74 VB How-To 14 February 14th, 2007 10:52 AM
HOW CAN SYSTEM DATE N TIME BE CAPTURED IN A TXTBOX cnkumar74 VB Databases Basics 6 February 14th, 2007 02:09 AM
store insert/update date/time stamp in sql2k db alexdcosta ASP.NET 2.0 Basics 0 June 22nd, 2006 05:44 AM
Time & date insert and display in myql/asp page karib MySQL 3 June 30th, 2004 05:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.