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

Notifications

Announcements

No record found.

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

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

  • rajivsewsarran Profile Picture
    22 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,848 Moderator on at

    I believe it is complaining about TIME1.

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

  • rajivsewsarran Profile Picture
    22 on at

    Hi Richard,

    That worked.. thanks for the assist!

  • Richard Wheeler Profile Picture
    75,848 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans