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 6341703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:05:28+00:00 2026-05-24T20:05:28+00:00

I have a problem converting dates while updating an SQL table in VB under

  • 0

I have a problem converting dates while updating an SQL table in VB under access: here is my code:

'Excel format date conversion
strSQL = "UPDATE tblBlotterINTLControl " & _
            "SET tblBlotterINTLControl.TradeDate = CVDate(TradeDate), " & _
                "tblBlotterINTLControl.SettleDate = CVDate(SettleDate);"
DoCmd.RunSQL strSQL

I obtain an error for each row: “type conversion error”
I have my tables in the right format though, please help thanks

EDIT:
I have to say that a SELECT request works but an UPDATE request doesn’t! why? how?

  • 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-05-24T20:05:29+00:00Added an answer on May 24, 2026 at 8:05 pm

    What are the data types of the TradeDate and SettleDate fields in the Access table tblBlotterINTLControl?

    SELECT TypeName(TradeDate) AS TypeOfTradeDate, TypeName(SettleDate) AS TypeOfSettleDate
    FROM tblBlotterINTLControl;
    

    Please paste that query into SQL View of a new query in Access, run it and show us what you get back.

    The reason I asked is because the SET statements in your UPDATE query puzzle me.

    SET tblBlotterINTLControl.TradeDate = CVDate(TradeDate)
    

    If the TradeDate field is Date/Time datatype, using the CVDate() function on it doesn’t accomplish anything.

    If the TradeDate field is text datatype, CVDate() will give you a variant date, but you can’t store that Date/Time value back to your text field.

    Maybe you would be better off using the Format() function. Here is a sample I copied from the Immediate Window:

    ? Format("2011/01/01", "d mmm yyyy")
    1 Jan 2011
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem while converting a string whose value is dd.mm.yyyy to DateTime
I have problem converting from string to date. The first one i Ok: Date
I have a strange problem. I convert a date using the following CONVERT(varchar(64), table.[Date],
I have a problem converting a string binary to a decimal I was using
Here is the problem: I have a WCF service and a few sites connecting
I have a process that is converting dates from GMT to Australian Eastern Standard
I have a problem converting a timestamp in javascript. I have this timestamp: 2011-10-26T12:00:00-04:00
I'm using SQL Server 2008 and my fields have DATE type but in Visual
Problem I have a timestamp that I am converting to an NSDate . Now
I seem to always have problems with converting data to and from XML in

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.