dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Datetime vs Date format

  1. #1
    Join Date
    Jul 2006
    Posts
    1

    Datetime vs Date format

    I am trying to create a sql with prompts on a DATETIME field, however, I want to convert to just to be able to handle just date. I don't want users to have to enter in the hour and min when the prompt appears. Is there some kind of expression I can create that will convert "12/02/06" to "12/02/06 12:00AM". Thank you in advance.

    SELECT A.AN_MT_ID, A.DESCR, A.AN_MT_MODULE, B.OPRDEFNDESC, A.AN_MT_STATUS, TO_CHAR(A.CREATED_DTTM,'YYYY-MM-DD-HH24.MI.SS."000000"'), TO_CHAR(A.DTTM_CLOSED,'YYYY-MM-DD-HH24.MI.SS."000000"'), C.OPRDEFNDESC, TO_CHAR(A.COMPLETION_DATE,'YYYY-MM-DD')
    FROM PS_AN_MT_HDR A, PSOPRDEFN B, PSOPRDEFN C, PS_AN_MT_ASSIGN_TO D
    WHERE A.CONTACT_ID = B.OPRID
    AND D.AN_MT_ID = A.AN_MT_ID
    AND D.ASSIGNED_TO = C.OPRID
    AND A.AN_MT_STATUS = :1
    AND A.DTTM_CLOSED > TO_DATE(SUBSTR(:2, 0, 19),'YYYY-MM-DD-HH24.MI.SS')

  2. #2
    Join Date
    May 2006
    Location
    the netherlands
    Posts
    454
    Quote Originally Posted by axl169
    Is there some kind of expression I can create that will convert "12/02/06" to "12/02/06 12:00AM".
    Exactly what do you want to convert and at which point.
    Do you want to do an UPDATE query on the existing data, converting all the datetimes to the same date with 12am as time. Do you want convert the user input before it enters the database. Etc.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles