Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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++

  • #3
    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
    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. ;)

  • #4
    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
    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.

  • #5
    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
    And a last question. Why do you need that time 00:00:00?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •