Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

SQL Insert issue

(0) ShareShare
ReportReport
Posted on by 22

Hi All,

I'm trying to insert a record into the pm10200 and i get the following error
conversion failed when converting date and /or time from character string


This is the format I'm using '2022-12-21 00:00:00.000'

i tried a couple different formats as well , but i got the same error... any help would be greatly appreciated.

Categories:
  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: SQL Insert issue

    Glad to help. Please mark my reply as the answer.

  • rajivsewsarran Profile Picture
    rajivsewsarran 22 on at
    RE: SQL Insert issue

    Hi Richard,

    That worked.. thanks for the assist!

  • Verified answer
    Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: SQL Insert issue

    I believe it is complaining about TIME1.

    Try inserting '1900-01-01 00:00:00.000'

  • rajivsewsarran Profile Picture
    rajivsewsarran 22 on at
    RE: SQL Insert issue

    HI Richard,

    USE [TEST]
    GO
    
    INSERT INTO [dbo].[PM10200]
               ([VENDORID]
               ,[DOCDATE]
               ,[DATE1]
               ,[GLPOSTDT]
               ,[TIME1]
               ,[APTVCHNM]
               ,[APTODCTY]
               ,[APTODCNM]
               ,[APTODCDT]
               ,[ApplyToGLPostDate]
               ,[CURNCYID]
               ,[CURRNIDX]
               ,[APPLDAMT]
               ,[DISTKNAM]
               ,[DISAVTKN]
               ,[WROFAMNT]
               ,[ORAPPAMT]
               ,[ORDISTKN]
               ,[ORDATKN]
               ,[ORWROFAM]
               ,[APTOEXRATE]
               ,[APTODENRATE]
               ,[APTORTCLCMETH]
               ,[APTOMCTRXSTT]
               ,[VCHRNMBR]
               ,[DOCTYPE]
               ,[APFRDCNM]
               ,[ApplyFromGLPostDate]
               ,[FROMCURR]
               ,[APFRMAPLYAMT]
               ,[APFRMDISCTAKEN]
               ,[APFRMDISCAVAIL]
               ,[APFRMWROFAMT]
               ,[ActualApplyToAmount]
               ,[ActualDiscTakenAmount]
               ,[ActualDiscAvailTaken]
               ,[ActualWriteOffAmount]
               ,[APFRMEXRATE]
               ,[APFRMDENRATE]
               ,[APFRMRTCLCMETH]
               ,[APFRMMCTRXSTT]
               ,[PPSAMDED]
               ,[GSTDSAMT]
               ,[TAXDTLID]
               ,[POSTED]
               ,[TEN99AMNT]
               ,[RLGANLOS]
               ,[APYFRMRNDAMT]
               ,[APYTORNDAMT]
               ,[APYTORNDDISC]
               ,[OAPYFRMRNDAMT]
               ,[OAPYTORNDAMT]
               ,[OAPYTORNDDISC]
               ,[Settled_Gain_CreditCurrT]
               ,[Settled_Loss_CreditCurrT]
               ,[Settled_Gain_DebitCurrTr]
               ,[Settled_Loss_DebitCurrTr]
               ,[Settled_Gain_DebitDiscAv]
               ,[Settled_Loss_DebitDiscAv]
               ,[Revaluation_Status]
               ,[Credit1099Amount]
               ,[DEFTEN99TYPE]
               ,[DEFTEN99BOXNUMBER])
         VALUES
            (  'ED15      ',
    	'2022-12-21 00:00:00.000',
    '2023-05-31 00:00:00.000',
    	'2023-05-31 00:00:00.000',
    '1',
    	'00000000000189315',
    	'1',
    	'53031933',
    	'2023-03-03 00:00:00.000',
    	'2023-03-15 00:00:00.000',
    	'Z-US$          ',
    '1007',
    	'27',
    	'0',
    	'0',
    	'0',
    	'27',
    	'0',
    	'0',
    	'0',
    '0',
    	'0',
    	'0',
    '0',
    '00000000000140374',
    '5',
    	'50665938',
    	'2023-12-28 00:00:00.000',
    	'Z-US$          ',
    	'27',
    	'0',
    	'0',
    	'0',
    '27',
    '0',
    '0',
    '0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'       0      ',
    	'1',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    	'0',
    '1',
    '0')
    
    GO
    
    
    

    Thanks for your response.

    Here you go!

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: SQL Insert issue

    Please reply with your code. That is the correct format. The SQL definition of date is datetime.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans