Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9294503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:23:19+00:00 2026-06-18T21:23:19+00:00

I’m really frustated right now, because I just can’t manage to get a VB.NET

  • 0

I’m really frustated right now, because I just can’t manage to get a VB.NET manually created DATE datatype into a DB2 column which is has the TIMESTAMP datatype.

I tried a few different ways to handle this, but no matter what I do I always get the error “SQL0180N: The syntax of the string representation of a datetime value is incorrect”.

The part in my application which handles the conversion from String to DATE is right here:

Dim neuesDatum As Date
neuesDatum = CDate(jahr & "-" & "0" & monat & "-01 00:00:00")

The String for the conversion looks like this: 2013-01-01 00:00:00

I also tried the german format of a date (01.01.203), tried to use the String without the last part (00:00:00), but no matter what I do it always ends up the same way.

I use a Stored Procedure to insert the Data into a Table. The Date is delivered as the parameter “SollMonat”.

CREATE OR REPLACE PROCEDURE "ADDON21C"."STP_BEITRAGSSATZ_ADD"
(
        IN @Id BIGINT,
        IN @Typ VARCHAR(100),
        **IN @SollMonat TIMESTAMP,**
        IN @G VARCHAR(100),
        IN @F VARCHAR(100),
        IN @H VARCHAR(100),
        IN @U1 VARCHAR(100),
        IN @U2 VARCHAR(100),
        IN @U1erhoeht VARCHAR(100),
        IN @U1ermaessigt VARCHAR(100),
        IN @RV VARCHAR(100),
        IN @ALV VARCHAR(100),
        IN @P VARCHAR(100),
        IN @RVgf VARCHAR(100),
        IN @KVgf VARCHAR(100),
        IN @ZusatzKV VARCHAR(100),
        IN @ZusatzPV VARCHAR(100),
        IN @Inso VARCHAR(100),
        OUT @result BIGINT
)
LANGUAGE SQL
SPECIFIC SQL12080109131643
BEGIN

        IF @Id IS NULL OR @Id = 0
        THEN
                INSERT INTO "ADDON21C".BS
                (Typ, Sollmonat, G, F, H, U1, U2, U1erhoeht, U1ermaessigt)
                VALUES
                (@Typ, @SollMonat, @G, @F, @H, @U1, @U2, @U1erhoeht, @U1ermaessigt);
                 SET @result = IDENTITY_VAL_LOCAL();
        END IF;

END

The datatype for “Sollmonat” inside of the datatable is TIMESTAMP, too.

Guys, I would be very happy if you can help me out here. I’m completely out of ideas and no, I can’t save the date as a VARCHAR in the table. Saving is as DATE in the database might be possible, but I believe I’d have the same problem there.

Thanks in advance!

@Steve It would only make the whole thing more confusing, because I build myself a few classes that allow me to map classes into datatables, but be assured that this isn’t what screws this up. When I use a not manually created date, like Date.Now for example, it works fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:23:20+00:00Added an answer on June 18, 2026 at 9:23 pm

    There are a couple of ways you might try this. One is specifically saying that your parameter is a timestamp, and pass in the Date type:

    cmdDB2.Parameters.Add("@SollMonat", DB2Type.Timestamp).Value = neuesDatum 
    

    Another possibility is defining the correct string representation of a date, and then using .ToString(). Below are a couple format strings, use the one that match your database’s data type.

    Private Const DB2_TSTAMP = "yyyy-MM-dd-HH.mm.ss.ffffff"
    Private Const DB2_DATE = "MM/dd/yyyy"
    
    cmdDB2.Parameters.Add("@SollMonat", neuesDatum.ToString(DB2_TSTAMP))
    

    These options have worked for me in the past. The timestamp format string should work all the time (it is the ODBC standard for a timestamp), but the date format string may vary by location, have a look at this article in Information Center.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am using JSon response to parse title,date content and thumbnail images and place
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I upgraded downgraded to rails 2.3.17 due to the security bugs, but now I
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.