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. convert varchar to datetime

convert varchar to datetime

Scheduled Pinned Locked Moved Database
database
5 Posts 4 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.
  • D Offline
    D Offline
    dandamudi padma
    wrote on last edited by
    #1

    hi i havae to insert data from one record to another for that i created a trigger CREATE TRIGGER trigInsertion on master AFTER insert as INSERT into child SELECT Convert(varchar(50),master_date,105) FROM inserted in this i need to convert varchar to datetime and insert these values into child table but it is not working padma

    J K M 3 Replies Last reply
    0
    • D dandamudi padma

      hi i havae to insert data from one record to another for that i created a trigger CREATE TRIGGER trigInsertion on master AFTER insert as INSERT into child SELECT Convert(varchar(50),master_date,105) FROM inserted in this i need to convert varchar to datetime and insert these values into child table but it is not working padma

      J Offline
      J Offline
      joemonvarghese
      wrote on last edited by
      #2

      hi for converting varchar to date use convert(datetime,FIELD) try to include the error message..so that we can identify the problem Regards Joe

      D 1 Reply Last reply
      0
      • J joemonvarghese

        hi for converting varchar to date use convert(datetime,FIELD) try to include the error message..so that we can identify the problem Regards Joe

        D Offline
        D Offline
        dandamudi padma
        wrote on last edited by
        #3

        in sql express How we know that user has inserted new row or update old row, is there any keyword to find out. padma

        1 Reply Last reply
        0
        • D dandamudi padma

          hi i havae to insert data from one record to another for that i created a trigger CREATE TRIGGER trigInsertion on master AFTER insert as INSERT into child SELECT Convert(varchar(50),master_date,105) FROM inserted in this i need to convert varchar to datetime and insert these values into child table but it is not working padma

          K Offline
          K Offline
          Krish KP
          wrote on last edited by
          #4

          In what format dates are stored in "master_date" As you are using 105 (style) it should be in "dd-mm-yy" format

          Regards KP

          1 Reply Last reply
          0
          • D dandamudi padma

            hi i havae to insert data from one record to another for that i created a trigger CREATE TRIGGER trigInsertion on master AFTER insert as INSERT into child SELECT Convert(varchar(50),master_date,105) FROM inserted in this i need to convert varchar to datetime and insert these values into child table but it is not working padma

            M Offline
            M Offline
            mahenputta
            wrote on last edited by
            #5

            I WILL TRY TO HELP YOU SOON THANKS MAHEN

            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