Forum Replies Created

Viewing 15 posts - 76 through 90 (of 124 total)

  • RE: Date Query Format Problem

    The data I receive is flat fixed width text file, the fastest way I could get this into my DB was to convert to CSV in my c# app...

  • RE: Date Query Format Problem

    Hi jeff I made them date time, columns trying to sort this mess out

    Jay

  • RE: Date Query Format Problem

    Hi your correct, I want to import a cvs to nvarchar columns then export the mentioned above to another table converting to a date time in the process

    Jay

  • RE: Date Query Format Problem

    Still failing

    UPDATE ProdDataTB SET StartDate_Time = ''

    --CREATE TABLE TestTable (Test NVARCHAR(100))

    insert into dbo.TestTable (Test)

    select StartDD+'-'+StartMM+'-'+StartYYYY+' '+StartHH+':'+StartMM+':'+StartSS from ProdDataTB T;

    insert into dbo.ProdDataTB (StartDate_Time)

    select convert(datetime,[Test],103) as [Date] from TestTable

    so slow

  • RE: Date Query Format Problem

    UPDATE ProdDataTB SET StartDate_Time = ''

    --CREATE TABLE TestTable (Test NVARCHAR(100))

    insert into dbo.TestTable (Test)

    select StartDD+'-'+StartMM+'-'+StartYYYY+' '+StartHH+':'+StartMM+':'+StartSS from ProdDataTB T;

    Select convert(datetime,[Test],103) as [Date] from TestTable

    looking better but how do I...

  • RE: Date Query Format Problem

    infact it doenst work

  • RE: Date Query Format Problem

    This is slow 🙁

    UPDATE ProdDataTB SET StartDate_Time = ''

    CREATE TABLE TestTable (Test DATETIME)

    insert into TestTable (Test)

    select CONVERT(datetime, StartDD+'-'+StartMM+'-'+StartYYYY+' '+StartHH+':'+StartMM+':'+StartSS) from ProdDataTB T;

  • RE: Date Query Format Problem

    insert into dbo.ProdDataTB(StartDate_Time)

    select StartDD+'-'+StartMM+'-'+StartYYYY+' '+StartHH+':'+StartMM+':'+StartSS from ProdDataTB AS T;

    this tells me x amount of rows effected but doesnt really change the StartDate_Time column

  • RE: Date Query Format Problem

    I can use this

    select StartDD+'/'+StartMM+'/'+StartYYYY from ProdDataTB AS T;

    how then do I overwrite the StartDate_Time column with the returned T and convert to datetime ?

  • RE: Date Query Format Problem

    The table can look like anything really, the rest I can play with. Stagging table sounds good, I just want to remove everything I don't need after but for now...

  • RE: Date Query Format Problem

    Sorry I mean at the no control over the the way I receive the data. I take the file convert to csv then bulk insert. lots of the columns I...

  • RE: Date Query Format Problem

    I was think thinking of removing all the data in the StartDate_Time column and adding the StartYYYY,StartMM,StartDD, StartHH, StartMM and populating StartDate_Time. Does this make sense

    like coalesce prehaps if that...

  • RE: Date Query Format Problem

    It gets better look at the create for the table

    USE [SLADB]

    GO

    /****** Object: Table [dbo].[ProdDataTB] Script Date: 09/01/2012 12:27:41 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[ProdDataTB](

    [MachineName] [nvarchar](10)...

  • RE: Date Query Format Problem

    Hi Chris, well that works for bring that date I added my part to the top

    SELECT * from SLADB.dbo.ProdDataTB

    where MachineName = ('APS01')

    Select

    d.StartDate_Time,

    date_string = p.[Year]+'-'+p.MonthNum+'-'+p.[Day]+' '+p.[Time],

    date_datetime = CONVERT(DATETIME,p.[Year]+'-'+p.MonthNum+'-'+p.[Day]+' '+p.[Time],120)

    FROM (SELECT...

  • RE: bcp with xml insert

    Hi all, if my file has a format date like mm/dd/yyyy and the server wants yyyy/mm/dd will this create this error ?

    Msg 4864, Level 16, State 1, Line 1

    Bulk load...

Viewing 15 posts - 76 through 90 (of 124 total)