EnviroInsite Forum

Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: Get Date - Specified Cast is not valid


Senior Member

Status: Offline
Posts: 271
Date:
Get Date - Specified Cast is not valid
Permalink  
 


I'm loading my Excel data file and have been getting the following error message:

GetDate

10/25/2014

Specified cast is not valid.

at System.Data.Odbc.OdbcDataReader.GetDateTime(Int32 i)

at ei_dblib3.ObsTbl.GetDate()

 

What do I do?



__________________


Senior Member

Status: Offline
Posts: 271
Date:
Permalink  
 

It’s running into a problem because it’s trying to read the date in the American date format “10/25/2014”. We would call that October 25, 2014. If you have your computer’s region set to English (Canada) then the program will try to interpret this as the 10th day of the 25th month of 2014, which obviously doesn’t mean anything. You have a couple of choices to resolve this problem: (1) Change the region to English (United States). This is done by opening the control panel and selecting Region and Language. Then simply select the correct region and click on the OK button. (2) Change the dates in your database as dd/MM/yyyy. (3) Enter the dates as dd-MMM-yyyy so that October 25, 2014 would be entered as 10-Oct-2014. If you continue to have a problem with this then send me your data file and I’ll fix it.



__________________
Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.



Create your own FREE Forum
Report Abuse
Powered by ActiveBoard