Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Date time so confuse.

Date time so confuse.

Scheduled Pinned Locked Moved Database
databaseoracle
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hmanhha
    wrote on last edited by
    #1

    Hi All. Firstly.I use Database link from my SQL to Oracle to get Data.In The Oracle the field sta_datetime is date type. Now I use convert(varchar(10),sta_datetime,111) as Sdate, convert(time,sta_datetime) as S_Time, To get data to Sdate field date type and S_Time field is time(0)type. Now I show them in the gridview and then get them back when user lick on the row to show on another child gridview. So many convert time.So it is so difficult to get them back.

    C 1 Reply Last reply
    0
    • H hmanhha

      Hi All. Firstly.I use Database link from my SQL to Oracle to get Data.In The Oracle the field sta_datetime is date type. Now I use convert(varchar(10),sta_datetime,111) as Sdate, convert(time,sta_datetime) as S_Time, To get data to Sdate field date type and S_Time field is time(0)type. Now I show them in the gridview and then get them back when user lick on the row to show on another child gridview. So many convert time.So it is so difficult to get them back.

      C Offline
      C Offline
      CHill60
      wrote on last edited by
      #2

      Your question is also confusing. So much so that I'm not sure what your question is! However, Don't convert date, datetime or time to varchar(anything) ... use the appropriate types. It is only in the final presentation of the data that you need to worry about how it looks

      H 1 Reply Last reply
      0
      • C CHill60

        Your question is also confusing. So much so that I'm not sure what your question is! However, Don't convert date, datetime or time to varchar(anything) ... use the appropriate types. It is only in the final presentation of the data that you need to worry about how it looks

        H Offline
        H Offline
        hmanhha
        wrote on last edited by
        #3

        Original type of field in Oracle Database is date.Now I select this and insert to SQL server.Then show in gridview. The question is How to get exactly data from oracle database link? And How to show exactly data to the user?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups