Results 1 to 7 of 7

Thread: toughest general question ever(date/time picker)!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    philippines
    Posts
    245

    toughest general question ever(date/time picker)!

    i am using MS ACCESS as my database and a date/time picker. the problem is if the value of the date/time picker is at 12:00:00 the it returns only the date.
    i.e
    if the value of btpTo is 01/01/2004 12:00:00 am it only retuns 01/01/2004 which is the date. the problem is i nee to get the exact date/time. any one has an idea on this?! hehehe





    to be clear.

    my database has:

    fieldname: mydt
    data type: date/time format: general date

    my code in VB:



    VB Code:
    1. rs.open "select * from myDB where id = 1",cn,1,1
    2. rs.addnew
    3. rs!mydt = "12/12/2004 12:00:00 am"
    4. rs.update

    result when saved into dbase.

    mydt(fieldname)
    12/12/2004



    time is missing! it should be 12/12/2004 12:00:00 am
    Last edited by titan7262; Feb 4th, 2004 at 04:15 AM.

  2. #2
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    philippines
    Posts
    245
    sorry for the comment about ms access. what i mean is that i am having problems with datetimepicker. if the date is 01/01/2004 12:00:00 am it only returns 01/01/2004 time is missing what can i do

  4. #4
    Addicted Member akki's Avatar
    Join Date
    Jun 2003
    Location
    Jungle
    Posts
    220
    As we know "01/01/2004 12:00:00" and "01/01/2004" are one and the same. Whats your porblem if it does not return time then?
    akki

  5. #5
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    You could just fill in the blank. See if the time is there, if it's not then add 12:00:00 to the string.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    philippines
    Posts
    245
    i need the whole values in my report. it's not a good idea if i just give the date and not time.

  7. #7
    Addicted Member akki's Avatar
    Join Date
    Jun 2003
    Location
    Jungle
    Posts
    220
    try this

    VB Code:
    1. MsgBox Format(DTPicker1.Value, "MM/DD/YYYY HH:MM:SS AM/PM")
    akki

Posting Permissions

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



Click Here to Expand Forum to Full Width