Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-25-2002, 04:37 PM   PM User | #1
head8k
New Coder

 
Join Date: Jun 2002
Location: London & Oxford
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
head8k is an unknown quantity at this point
Access date field trouble

Hi guys and gals

I'm trying to insert a date into a field in an Access table. This field is of the General Date type. I want the date to be entered as "dd/mm/yyyy hh:mm:ss" and this works fine until I try and enter the time part as 00:00:00 in which case the field only records the date part and not the time .

My question is how can I add "01/01/2002 00:00:00" and get the whole lot to be stored, not just the date part?

Thanks for any help
__________________
As easy as 3.1415926535897932384626433832795028841
head8k is offline   Reply With Quote
Old 07-30-2002, 03:49 AM   PM User | #2
NinjaTurtle
Regular Coder

 
Join Date: Jun 2002
Posts: 358
Thanks: 2
Thanked 0 Times in 0 Posts
NinjaTurtle is an unknown quantity at this point
last time i use Access too, but now i using SQL server. i think there is a firld type called datetime... or may be called datestamp.

to get the time & date, use now() or formatdatetime(now(),3)
the number "3" u can try 1 until 5.... c what u get n use it that u want...
__________________
Thanks.
=====================================================
From NinjaTurtle
++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++
NinjaTurtle is offline   Reply With Quote
Old 07-31-2002, 12:06 AM   PM User | #3
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
Have you tried using Date/Time as the data type?
__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)
whammy is offline   Reply With Quote
Old 08-01-2002, 04:53 AM   PM User | #4
Morgoth
Senior Coder

 
Morgoth's Avatar
 
Join Date: Jun 2002
Location: Ontario, Canada Remaining Brain Cells: 6
Posts: 1,402
Thanks: 2
Thanked 1 Time in 1 Post
Morgoth is an unknown quantity at this point
Your trying to save the time and the date?
or just the time?
or just the date?

Well, if you add Now() to you db, it will give you the date and time of submition.

In you db, you can select what type of information to show in the db.
Example:



If you select "Long Date" It will show:



But if you click on it, you can also see it does store the time:




Does this help?



And if that's not what you were asking, maybe you should think about what TIME is.

Time is never 00:00:00. Time goes from 12:00:00 to 1:00:00 and not to 13:00:00 nor 00:00:00. If you are manually putting in the time and date, you should look at your clock and say, well it's 11:54:00PM
Seeing how time doesn't metter too you, but it's really close.

In other words, if you are going to add the date at all, just use NOW()

You can also set it as the default text for your date/time field.
Morgoth is offline   Reply With Quote
Old 08-01-2002, 04:55 AM   PM User | #5
Morgoth
Senior Coder

 
Morgoth's Avatar
 
Join Date: Jun 2002
Location: Ontario, Canada Remaining Brain Cells: 6
Posts: 1,402
Thanks: 2
Thanked 1 Time in 1 Post
Morgoth is an unknown quantity at this point
And a last question. Why do you need that time 00:00:00?
Morgoth is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:05 AM.


Advertisement
Log in to turn off these ads.