web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

SQL Insert issue

(0) ShareShare
ReportReport
Posted on by 44

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:
I have the same question (0)
  • Richard Wheeler Profile Picture
    75,852 Moderator on at

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

  • rajivsewsarran Profile Picture
    44 on at

    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!

  • Verified answer
    Richard Wheeler Profile Picture
    75,852 Moderator on at

    I believe it is complaining about TIME1.

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

  • rajivsewsarran Profile Picture
    44 on at

    Hi Richard,

    That worked.. thanks for the assist!

  • Richard Wheeler Profile Picture
    75,852 Moderator on at

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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 517 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 440

#3
Adis Profile Picture

Adis 266 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans