dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Changing Date Format

Question:
I am having trouble saving dates into an Access 1.1 DateTime field. The aplication I am writing is for the European market, so international dates are a problem as well. I am putting the current date into a Truegrid table as a string. When I try to convert it into a date I get Type Mismatch error. I get the same error if I try and save it to the database. Any advice would be most welcome. Thank you.

Answer:
Try this for converting string to date:

DateField = CVar(String)
For converting from date to string, try using the Format$ function like this:
String = Format$(DateField, "MM-DD-YY")
Also be aware that your problems might lie with the codepage that your keyboard is set to. If you're using a "US English" codepage and are trying to translate to a different (i.e. European) format it might be causing the type mismatch.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date