Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    202

    Unanswered: Convert date and time to string?

    Hi,

    Can anyone tell me how to convert date and time to string.

    I got one field inside my database which contain data like below:

    4/16/2004 10:19:01 AM

    if i wan to call out a record which have to refer to the data above

    Select *
    From table_A
    where field_date= ???????

    what to fill in the ??????

    Thanx

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Man, you were so close! Use:
    PHP Code:
    Select *
       
    FROM table_A
       WHERE field_date 
    '4/16/2004 10:19:01 AM' 
    -PatP

  3. #3
    Join Date
    Mar 2004
    Posts
    202
    Originally posted by Pat Phelan
    Man, you were so close! Use:
    PHP Code:
    Select *
       
    FROM table_A
       WHERE field_date 
    '4/16/2004 10:19:01 AM' 
    -PatP

    hi there again.....

    I tired like what you hav told me but i cant get any output from the query statement lo.its like the record doesn't exist.

    its like the format i keyed in is not the same.

    Can u pls explain .
    thanx

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    My guess would be that you are missing the milliseconds. The value in the database probably has milliseconds, but your constant does not.

    Databases are finicky about things like that!

    -PatP

Posting Permissions

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