Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a simple question, I'm trying to pull a datetime value from sql

Status
Not open for further replies.

hoggle

Programmer
Jul 13, 2001
124
US
I'm trying to display a datetime value from my sql server 2000 database. When ever crystal pulls the field it only shows &quot;<<''&quot;
and when I try to convert it using:
CDate (totext({tblProductionReporting.ProductionTime}))
crystal says &quot;Bad Date Format String&quot;

the date stored in my database is default sql server datetime: &quot;7/3/2003 10:55:00 AM&quot;

thanks for any help
 
I use datettimes often in SQL Server 2000, so it has nothing to do with that, although you didn't share what version of Crystal you are using, or the way you are connecting.

If ODBC, make sure that you use the CR SQL Server driver, not the MS one.

After assuring that you are using the proper connectivity, right click the field and select Browse Field Data, it should show as a datetime, if not, then it may not be a datetime in the database, rather a string in a standardized datetime format.

-k
 
I'm using crystal 8.5
and I'm connecting to sql via crystals pdssql.dll (SQL SERVER) database driver, so I'm not connection through ODBC.
also
I checked the data in the database and its a datetime type, which is filled by my visual basic6 program using vbs date functions.

I also checked the selection on the date field and all of them are messed up, it just has wierd characters like carriage breaks, carrots, and greater than/less than signs (stuff like the in it).

thanks for the ideas so far
 
Ugh...

Well I guess that the first thing I would try is to create a new report using your current connectivity which only hits that one table and browse/display the data.

Then I'd try switching to the CR ODBC driver and test the field.

Hopefully the problem is within Crystal, and not corruption in the database.

Also make sure that you apply the monthly hotfixes from CD:


-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top