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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:32:48+00:00 2026-06-13T08:32:48+00:00

I have the following code to convert a date (from a database entry) into

  • 0

I have the following code to convert a date (from a database entry) into the correct format:

Dim blah As Date = "02/29/2001"
MsgBox(Format(blah, "yyyy-MM-dd"))

However, it keeps telling me this:

Conversion from string “02/29/2001” to type ‘Date’ is not valid.

Now i see that 2/29/2001 does not have a day 29- only 28 for that year. So how would i check for this so it doesn’t throw an error when a date in the database table is not entered correctly?

  • 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-13T08:32:49+00:00Added an answer on June 13, 2026 at 8:32 am

    You can use IsDate()

    This function returns true if your string or date can be converted to date.

    like this

    Dim dateAndTime As String
    dateAndTime = "March 15, 1981 10:22 AM"
    noDate = "Hello"
    dateCheck = IsDate(dateAndTime)
    dateCheck = IsDate(noDate)
    

    This will return true for the first one and false for the second one

    Also, this function works with month of 29, 30 or 31 days like in your case

    here’s the msdn link

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

Sidebar

Related Questions

I have the following code to convert different string representations of date/datetime into timestamp
I have the following code that is meant to convert milliseconds into hours, mins
I have never used Foxpro before. Can you convert the following Foxpro code into
I have the following date: 2011-05-24T11:40:41Z How can I convert this into a Joda
I have the following from a Microsoft SQL Server database for date/time value: 0x00009CEF00A25634
How to get the millisecond time from date? I have the following code. Date
I have used following code to convert string to json and parse it. String
I have the following code to convert the type of the matrix using cv::Mat.convertTo()
I have the following code sample: float val = 16777216.0F; var badResult = Convert.ToDecimal(val);
I have the following FORTRAN code which I need to convert to C or

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.