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

  • Home
  • SEARCH
  • 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 127811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:32:09+00:00 2026-05-11T05:32:09+00:00

I have a VB6 application which works with datetime values in SQL Server (which

  • 0

I have a VB6 application which works with datetime values in SQL Server (which are obviously storing dates as mm/dd/yyyy).

I need to represent these dates to the user as dd/mm/yyyy, read them in as dd/mm/yyyy, and then store them back into the database as the standard mm/dd/yyyy.

This is the current code snippets I have which pull + insert the dates, however I have read many conflicting methods of handling the conversions, and I was wondering if anyone here knew a clear solution for this situation.

'SELECT * FROM List WHERE DateIn LIKE '%' & txtDateIn.Text & '%''  'UPDATE [Progress] SET [Date] = '' & txtDate.Text & '''  txtDate.Text = '' & RecordSet.Fields('Date').Value 

Any thoughts? Thanks in advance.

**Update

Actually I just noticed I do have dates stored in datetime fields in the form of 16/08/2009 00:00:00 which is dd/mm/yyyy. So perhaps I misunderstood the problem. But when trying to update the datetime value I have been getting ‘The conversion of char data type to a datetime data type resulted in an out-of-range datetime value.’.

I assumed this was because the date formats did not match (causing a problem with having a month value out of range) however I do have date values in the format of day/month/year in the datetime field already. And the date being submitted to the database is definitely dd/mm/yyyy.

**** Update 2**

Ok, there seems to be some confusion I have caused. I apologize.

  • I am storing the dates as datetime in the SQL database
  • The texts are TextBox controls in the VB6 application
  • I am running SQL SELECT statements to read the dates from the database and place the value in a TextBox
  • I then have a ‘commit’ command button which then performs an UPDATE SQL statement to place the value of the TextBox into the datetime field in the SQL database
  • This works perfectly fine until 1 specific occasion.

In this occasion I have a datetime value (which SQL Server 2005 displays as 16/08/2009 00:00:00) which is read from the database and populated the TextBox with the value 16/08/2009. Now when I try to run the UPDATE statement without modifying the TextBox text I get the error ‘The conversion of char data type to a datetime data type resulted in an out-of-range datetime value.’

This does not occur with other records such as one where the date is 04/08/2009 so the only issue I can see is possibly with the position of day and month in the value because if the DB is expecting month first then obviously 16/08/2009 would be out-of-range. However the value in the database is already 16/08/2009 with no issues.

  • 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. 2026-05-11T05:32:10+00:00Added an answer on May 11, 2026 at 5:32 am

    Well after all of that the problem was simple. I have the date value wrapped in single (‘) and double (‘) quotes. The problem was encountered due to date values not requiring the single quotes. Removing them solved the issue.

    Thank you anyway for trying to help all.

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

Sidebar

Ask A Question

Stats

  • Questions 89k
  • Answers 89k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Edit: With your latest update, I still recommend looking into… May 11, 2026 at 5:57 pm
  • Editorial Team
    Editorial Team added an answer polsedit (source: southsoftware.com) "Polsedit is a freeware utility that allows… May 11, 2026 at 5:57 pm
  • Editorial Team
    Editorial Team added an answer I know the Galio project have it on their roadmap… May 11, 2026 at 5:57 pm

Related Questions

I will likely be responsible for porting a vb6 application to c#. This application
I work on a vb6 application which is having problems with Vista, for the
I was recently given an older ASP web application to maintain. I haven't touched
Part of my everyday work is maintaining and extending legacy VB6 applications. A common

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.