Transfering data from a table to another table!!!Help plsss..

sql server France
  • 10 years ago

    HI all!!

    I have a pb when i transfering data from a table named INCIDENT to a table GI_INCIDENTS....

    In the table INCIDENT  i have startdate,enddate,starttime,endtime

    And in the table GI_INCIDENTS i have startdate and enddate -->format yyyy/MM/dd hh:mm:ss.ttt..

    INCIDENT is a migirated table from access...Then with a query i transfered datas to GI_INCIDENTS...

    The pb is in INCIDENT Table, date of beginning incident is (2003/06/18 ) but when i excute my insert query,in the table GI_INCIDENTS, date of beginning incident is (2003/06/06)...So i have 2 days delay in the all colums...

    INCIDENT-->enddate (2006/11/30)

    GI_INCIDENT-->enddate(2006/11/28)

    I didn't understand the fact...

    The query:

    Insert into GI_INCIDENTS(GIIN_ID,GIIN_STA_INCIDENT,STARTDATE,ENDDATE,GIIN_TYPE,GIIN_RESUME,GIIN_DESCRIPTION,GIIN_IMPACT_ANTENNE,GIIN_INITIATEUR)
    select NUMINCIDENT,CODETAT,STARTDATE+ ' ' + STARTTIME, ENDDATE + ' ' + ENDTIME,CODETYPE,NATURE,DESINCIDENT,CODBLOQ,NUMEXPL From INCIDENT
    set IDENTITY_INSERT GI_INCIDENTS off

    Thanks a lot for your help..

    Mathumitha

  • 10 years ago

    You'll find the problem in the Incident table... the migration failed to copy the correct dates somewhere.  And, the difference between 2003/06/18 and 2003/06/06 is a heck of a lot more than just 2 days.

    Anyway, check the Incident table for Min and Max dates.

  • 10 years ago
  • 10 years ago

    Hi,

    Just a suggestion, maybe its much better if you can make a little changes either in INCIDENT table or GI_INCIDENT when it comes to the datefields. I think its more ideal if the two has the same structure of fields, instead of concatenating the date and the time and put it in just one field or may be you can create a date field and a time field in GI_INCIDENT table.

     

    Regards,

    Reivax

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray